[GRASS-user] v.out.ogr to GeoJSON + crs definition

Hi everybody,

is it possible to make v.out.ogr specify the projection when exporting to GeoJSON?

I.e. to have a “crs” field:

{
“type”: “FeatureCollection”,
“crs”: {
“type”: “name”,
“properties”: { “name”: “urn:ogc:def:crs:EPSG::3358” }
},
“features”: [
{
“type”: “Feature”,
“properties”: { “cat”: 1 },
“geometry”: {
“type”: “Point”,
“coordinates”: [ 642989.51049, 227690.559441, 0.0 ]
}
}
]
}

all the best,
Panos

Hi,

On Mon, Feb 1, 2016 at 9:14 PM, Panagiotis Mavrogiorgos
<pmav99@gmail.com> wrote:

Hi everybody,

is it possible to make v.out.ogr specify the projection when exporting to
GeoJSON?

I.e. to have a "crs" field:

...

could you please check if OGR can do that (ogr2ogr)? I vaguely
remember that the CRS part is not written out (hence, also not by
v.out.ogr).

If OGR can do that, then we may start bug hunting :slight_smile:

Markus

On Wed, Feb 3, 2016 at 12:06 AM, Markus Neteler <neteler@osgeo.org> wrote:

Hi,

On Mon, Feb 1, 2016 at 9:14 PM, Panagiotis Mavrogiorgos
<pmav99@gmail.com> wrote:
> Hi everybody,
>
> is it possible to make v.out.ogr specify the projection when exporting to
> GeoJSON?
>
> I.e. to have a "crs" field:
...

could you please check if OGR can do that (ogr2ogr)? I vaguely
remember that the CRS part is not written out (hence, also not by
v.out.ogr).

If OGR can do that, then we may start bug hunting :slight_smile:

Hi Marcus, yes ogr2ogr does seem able to do that. I opened the following

bug: https://trac.osgeo.org/grass/ticket/2893