gis:load-dataset
gis:load-dataset file
Loads the given data file, re-projecting the data as necessary.
Relative paths are resolved relative to the location of the current model, or the user’s home directory if the current model hasn’t been saved yet.
For ESRI shapefiles and ESRI grid files, if there is a “.prj” file associated with the file, then load-datset
will consult that file and re-project to the current global projection if needed. If no “.prj” file is found, then the data is assumed to use the same projection as the current global coordinate system.
For GeoJSON files, as per the most-recent specification (RFC 7946), the coordinate system for GeoJSON files is always WGS84 and will be imported accordingly.
Currently, three types of data file are supported:
- “.shp” (ESRI shapefile): contains vector data, consisting of points, lines, or polygons. When the target file is a shapefile,
load-dataset
reports a VectorDataset. - “.asc” or “.grd” (ESRI ASCII grid): contains raster data, consisting of a grid of values. When the target file is an ASCII grid file,
load-dataset
reports a RasterDataset. - “.geojson” or “.json” (GeoJSON): contains vector data similar to shapefiles and similarly reports a VectorDataset.
Note that not all aspects of the GeoJSON standard are supported. In particular, to be properly imported, a GeoJSON file must satisfy the following:
- It only contain numeric or string data within the properties. all other json data will be stringified.
- All “Features” within a “FeatureCollection” must be of the same shape type (“Point”, “LineString”, etc.) Additionally, if not all the “Features” in the “FeatureCollection” have the same set of property names, default values will be supplied where there are missing entries (0 for numbers and "" for strings.)
- It must not use “GeometryCollection”, which is not supported
Elevation/Z data is partially supported. For both .geojson and .shp files, single points with Z data will have their Z coordinate moved to a new “_Z” property that can be accessed with gis:property-value
like any other property. Any Z information for other shape types will be discarded upon import.
Take me to the full GIS Extension Dictionary