#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:
Keywords: v.in.ogr v.import | CPU: Unspecified
Platform: Unspecified |
-------------------------------+-------------------------
I was trying to use `v.import` and I think I run into a bug. AFAIK the
error is caused by `v.in.ogr -i`.
In this container I was using [67592] so this should be present in
`7.0.3`.
These are the steps to reproduce it:
1. Create a file with the following contents and save it e.g. as
`~/input.json`:
{{{#!python
{
"type": "MultiPoint",
"coordinates": [
[
-105.01621,
39.57422
],
[
-80.6665134,
35.0539943
]
]
}
}}}
2. Create a new GRASS location:
{{{
grassuser@4b5e00241b91:~$ grass -e -c EPSG:4326 ~/locations/epsg_4326
WARNING: Default locale settings are missing. GRASS running with C locale.
WARNING: Searched for a web browser, but none found
Cleaning up temporary files...
Creating new GRASS GIS location/mapset...
Cleaning up temporary files...
}}}
3. Start a new GRASS session using the location you just created.
{{{
grassuser@4b5e00241b91:~$ grass --text ~/locations/epsg_4326/PERMANENT/
WARNING: Default locale settings are missing. GRASS running with C locale.
WARNING: Searched for a web browser, but none found
Cleaning up temporary files...
Starting GRASS GIS...
GRASS 7.0.3svn (epsg_4326):~ >
}}}
4. Create a new location using the JSON file you created on step 1:
{{{
GRASS 7.0.3svn (epsg_4326):~ > v.in.ogr input=~/my_input.json -i
location=example_multi_point
WARNING: All available OGR layers will be imported into vector map
<OGRGeoJSON>
Location <example_multi_point> created
GRASS 7.0.3svn (epsg_4326):~ >
}}}
As we can see the location was created without problems.
5. Replace the contents of the file we created on step 1 with the
following snippet (in this case we are importing just a single point):
{{{#!python
{
"type": "Point",
"coordinates": [0, 0]
}
}}}
6. Try to create a location using the new JSON file:
{{{
GRASS 7.0.3svn (epsg_4326):~ > v.in.ogr input=~/my_input.json -i
location=example_single_point
WARNING: All available OGR layers will be imported into vector map
<OGRGeoJSON>
Location <example_single_point> created
ERROR: Syntax error in cell header
}}}
As you can see, even though the location gets created, we get an ERROR.
--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2878>
GRASS GIS <https://grass.osgeo.org>