write geoshape

From DavinciWiki
Jump to: navigation, search

Description

Write any GeoShape-Struct to any type supported by GDAL by translating to a CSV sa GeoShape-Struct. Input is not translated if it is already a CSV shapefile, and the shape geometry is assumed to be the field "wkt".

This function relies on GDAL > 1.8.

This function nominally supports all formats GDAL can write.

Arguments and Return Values

Arguments: A davinci GeoShape-Struct and Filename

Return Value: none

Usage

Syntax: write_geoshape(filename, GeoShape-Struct [,force=BOOL][,t_srs=STRING][,a_srs=STRING][,s_srs#61;STRING][,opts=STRING][,type=STRING])

filename = input full path to data

GeoShape-Struct = davinci GeoShape-Struct to write

force=overwrite any existing files (Default=0)

t_srs=projction of the target (reprojection will occur, Default="")

s_srs=projection of the source (Default="")

a_srs=projection of the output (reprojection will not occur, Default="")

opts=additional ogr2ogr options (Default="")

type=set the ouptut type from ogr2ogr (Default="CSV")


Common output types:

"CSV", "ESRI Shapefile", "KML", "MySQL","PostgrSQL"

Examples

dv> shape=read_geoshape($DV_EX+"/test_shape.csv")
Downloading.done.
struct, 5 elements
   feature_string: Text Buffer with 2 lines of text
       1: polygon
       2: polygon
   mola_elevation_double: 1x2x1 array of float, bsq format [8 bytes]
   line_color_color: Text Buffer with 2 lines of text
       1: 0 255 255
       2: 204 0 0
   fill_color_color: Text Buffer with 2 lines of text
       1: 153 0 153
       2: 0 0 255
   wkt: Text Buffer with 2 lines of text
       1: POLYGON ((5.59375 9.4375, 3.1875 8.15625, 3.1875 6.15625, 3.9375 4.03125,\
        5.65625 3.90625, 6.28125 5.125, 6.21875 7.0625, 6.09375 9, 5.59375 9.4375))
       2: POLYGON ((12.375 11.5625, 10.15625 11.96875, 8.8125 10.71875, 8.0625 9.1875,\
        8.1875 8, 9.34375 7.3125, 10.28125 8.125, 10.625 8.9375, 11.6875 9.21875, 12.25 8.875,\
        12.875 8.9375, 13.09375 9.59375, 13.09375 10.34375, 12.375 11.5625))

dv> write_geoshape(shape,"~/testing.csv")

DavinciWiki Mini-Nav Bar

Contents


Contact Developers

  • davinci-dev [AT] mars.asu.edu

All other topics

  • See navigation on the left

Major Sub-Functions

Recent Library Changes

Created On: 05-14-2013
Modified On: 05-14-2013

Personal tools