[GRASS-dev] [GRASS GIS] #2878: "v.in.ogr -i" throws an error when importing a GeoJSON file containing a single point.

GRASS GIS trac at osgeo.org
Wed Jan 27 08:49:19 PST 2016


#2878: "v.in.ogr -i" throws an error when importing a GeoJSON file containing a
single point.
--------------------------+-------------------------------
  Reporter:  pmav99       |      Owner:  grass-dev@…
      Type:  defect       |     Status:  new
  Priority:  normal       |  Milestone:  7.0.3
 Component:  Vector       |    Version:  unspecified
Resolution:               |   Keywords:  v.in.ogr v.import
       CPU:  Unspecified  |   Platform:  Unspecified
--------------------------+-------------------------------

Comment (by pmav99):

 Even though I cannot really comment whether this is actually valid syntax
 according to the spec ([http://geojsonlint.com | GeoJSON linters] accept
 it though), on my machines `ogrinfo` opens the file without problems:

 On Ubuntu 14.04:
 {{{

 grassuser at c732646a6bda:~/repo$ ogrinfo  --version
 GDAL 1.11.3, released 2015/09/16

 grassuser at c732646a6bda:~/repo$ ogrinfo -so /tmp/example.json
 ERROR 4: GeoJSON Driver doesn't support update.
 Had to open data source read-only.
 INFO: Open of `/tmp/example.json'
       using driver `GeoJSON' successful.
 1: OGRGeoJSON (Point)

 grassuser at c732646a6bda:~/repo$ ogrinfo -al /tmp/example.json
 ERROR 4: GeoJSON Driver doesn't support update.
 Had to open data source read-only.
 INFO: Open of `/tmp/example.json'
       using driver `GeoJSON' successful.

 Layer name: OGRGeoJSON
 Geometry: Point
 Feature Count: 1
 Extent: (0.000000, 0.000000) - (0.000000, 0.000000)
 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
   POINT (0 0)
 }}}
 On Archlinux using a newer GDAL version:
 {{{
 $ ogrinfo --version
 GDAL 2.0.1, released 2015/09/15

 $ ogrinfo -so /tmp/example.json
 ERROR 4: GeoJSON Driver doesn't support update.
 Had to open data source read-only.
 INFO: Open of `/tmp/example.json'
       using driver `GeoJSON' successful.
 1: OGRGeoJSON (Point)

 $ ogrinfo -al /tmp/example.json
 ERROR 4: GeoJSON Driver doesn't support update.
 Had to open data source read-only.
 INFO: Open of `/tmp/example.json'
       using driver `GeoJSON' successful.

 Layer name: OGRGeoJSON
 Geometry: Point
 Feature Count: 1
 Extent: (0.000000, 0.000000) - (0.000000, 0.000000)
 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
   POINT (0 0)
 }}}

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2878#comment:2>
GRASS GIS <https://grass.osgeo.org>



More information about the grass-dev mailing list