2

In the documentation for the GDAL GeoJSON driver, I can only see mention of primitive geometries. Does the GDAL GeoJSON driver read multipart geometries like MultiLineString? If not, is there another established GeoJSON driver with a python interface that can read multipart GeoJSON type geometries from a URL?

2

GDAL has no problem with GeoJSON http://geojson.org/geojson-spec.html. The following GeoJSON encodes one multilinestring:

{
"type": "FeatureCollection",

"features": [
{ "type": "Feature", "geometry": {"type":"MultiLineString","coordinates":[[[11.20558631,46.48251782],[11.2058444,46.48280049]],[[11.20578705,46.48252192],[11.20596731,46.48275133]]],"crs":{"type":"name","properties":{"name":"EPSG:4326"}}} }
]

}

Save as multiline.json and test with ogrinfo:

ogrinfo multiline.json -al
INFO: Open of `multiline.json'
      using driver `GeoJSON' successful.

Layer name: OGRGeoJSON
Geometry: Multi Line String
Feature Count: 1
Extent: (11.205586, 46.482518) - (11.205967, 46.482800)
Layer SRS WKT:
GEOGCS["WGS 84",
    DATUM["WGS_1984",
        SPHEROID["WGS 84",6378137,298.257223563,
            AUTHORITY["EPSG","7030"]],
        AUTHORITY["EPSG","6326"]],
    PRIMEM["Greenwich",0,
        AUTHORITY["EPSG","8901"]],
    UNIT["degree",0.0174532925199433,
        AUTHORITY["EPSG","9122"]],
    AUTHORITY["EPSG","4326"]]
OGRFeature(OGRGeoJSON):0
  MULTILINESTRING ((11.20558631 46.48251782,11.2058444 46.48280049),(11.20578705
 46.48252192,11.20596731 46.48275133))

GDAL probably has problems with the ESRI style JSON that is also handled with the same GDAL driver than GeoJSON http://www.gdal.org/drv_geojson.html.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.