GeoCSV: Unterschied zwischen den Versionen
Aus Geoinformation HSR
Stefan (Diskussion | Beiträge) K |
Stefan (Diskussion | Beiträge) K |
||
Zeile 8: | Zeile 8: | ||
* Strings are enclosed by parantheses, to allow delimiters inside (e.g. "string"). | * Strings are enclosed by parantheses, to allow delimiters inside (e.g. "string"). | ||
* Data types (if supported from source or target system): See CSVT file format specification. | * Data types (if supported from source or target system): See CSVT file format specification. | ||
− | * | + | |
+ | Notes: | ||
+ | * End-of-lines are: CR, LF or CR/LF. | ||
+ | * Line Breaks in (String) fields are disallowed. | ||
+ | * Convert CSV-to-[[GeoJSON]]: [http://www.convertcsv.com/csv-to-geojson.htm convertcsv.com]/[http://mapbox.github.io/csv2geojson/ csv2geojson], GeoJSON-to-CSV: [http://www.convertcsv.com/geojson-to-csv.htm convertcsv.com] | ||
=== GeoCSV file format specification === | === GeoCSV file format specification === | ||
Zeile 25: | Zeile 29: | ||
Common restrictions: | Common restrictions: | ||
+ | * Coordinate system is WGS84 (EPSG:4326) by default. | ||
* There is only one geometry column allowed per sheet. | * There is only one geometry column allowed per sheet. | ||
* All geometry values within one table are in the same coordinate reference system ([[CRS]]). | * All geometry values within one table are in the same coordinate reference system ([[CRS]]). | ||
Zeile 40: | Zeile 45: | ||
* The geometry types are a kind of subtype: easting and northing values are stored as float, option WKT is stored in one column of type String. | * The geometry types are a kind of subtype: easting and northing values are stored as float, option WKT is stored in one column of type String. | ||
* See also http://www.gdal.org/drv_csv.html section with .csvt extension. | * See also http://www.gdal.org/drv_csv.html section with .csvt extension. | ||
+ | |||
+ | === Example === |
Version vom 1. Mai 2015, 01:15 Uhr
Specification of a 'modern' CSV with a geometry extension of either two easting/northing colums or one WKT column!
Inhaltsverzeichnis
CSV file format specification
- Encoding is UTF-8 by default.
- First row contains attribute names separated by a => delimiter.
- Following rows are contains values separated by a => delimiter.
- Delimiter is semicolon (;) by default.
- Strings are enclosed by parantheses, to allow delimiters inside (e.g. "string").
- Data types (if supported from source or target system): See CSVT file format specification.
Notes:
- End-of-lines are: CR, LF or CR/LF.
- Line Breaks in (String) fields are disallowed.
- Convert CSV-to-GeoJSON: convertcsv.com/csv2geojson, GeoJSON-to-CSV: convertcsv.com
GeoCSV file format specification
GeoCSV is based on CSV. The extension comes with two variants: Options easting/northing and Options WKT.
Option "easting/northing" (longitude/latitude, similar to x/y in mathematics):
- Geometry Point type as two neighboring columns of type Float: one containing the easting coordinate, and one containing northing coordinate separated by the common delimiter.
- Example for the two easting/northing columnts "8.8249;47.2274".
- This option supports only Points.
Option WKT:
- It' one single column of type String containing a constructor, like for example: "POINT (8.8249 47.2274)".
- This option supports Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon.
- WKT ("Well Known Text") is originally defined by the Open Geospatial Consortium (OGC) and described in their Simple Feature Access specification (also ISO SQL/MM). See e.g. http://en.wikipedia.org/wiki/Well-known_text
Common restrictions:
- Coordinate system is WGS84 (EPSG:4326) by default.
- There is only one geometry column allowed per sheet.
- All geometry values within one table are in the same coordinate reference system (CRS).
CSVT file format specification
Field/column types, case insensitive (if supported from source or target system):
- Integer
- Real
- String
- Date ("YYYY-MM-DD"), Time ("HH:MM:SS+nn") and DateTime (YYYY-MM-DD HH:MM:SS+nn)
- (lon/lat)
- (WKT)
Notes:
- The geometry types are a kind of subtype: easting and northing values are stored as float, option WKT is stored in one column of type String.
- See also http://www.gdal.org/drv_csv.html section with .csvt extension.