[GRASS-user] Unable to export vector data after upgrading to GRASS 8

Amit Ghosh ghoshamitag at gmail.com
Mon Apr 4 04:29:36 PDT 2022


Dear Mr. Micha,
Yes, it is EPSG: 102022,  I used the proj4 string to create the location.
Many thanks for the solution. It worked. However, the v.out.ogr module
exports the file without the CRS.

> Projection information updated
> (Mon Apr  4 16:44:33 2022) Command finished (0 sec)
>
> (Mon Apr  4 16:44:45 2022)
>
> g.proj -p
>
> -PROJ_INFO-------------------------------------------------
> name       : Africa_Albers_Equal_Area_Conic
> datum      : wgs84
> ellps      : wgs84
> proj       : aea
> lat_0      : 0
> lon_0      : 25
> lat_1      : 20
> lat_2      : -23
> x_0        : 0
> y_0        : 0
> no_defs    : defined
> -PROJ_SRID-------------------------------------------------
> SRID       : EPSG:102022
> -PROJ_UNITS------------------------------------------------
> unit       : meter
> units      : meters
> meters     : 1
>

v.out.ogr input=MDG_UNSALB_admin3_selectionSN5 at PERMANENT
> output=/home/amit/Documents/mdg_unsalb_east_mdg.gpkg format=GPKG
> proj_create: crs not found
> Exporting 7 areas (may take some time)...
> v.out.ogr complete. 7 features (Polygon type) written to
> <MDG_UNSALB_admin3_selectionSN5> (GPKG format).
> (Mon Apr  4 16:45:39 2022) Command finished (0 sec)
>
>
> Kind regards,
Amit

On Mon, 4 Apr 2022 at 16:33, Micha Silver <tsvibar at gmail.com> wrote:

> Hello:
>
>
> On 04/04/2022 13:38, Amit Ghosh wrote:
> > Hi,
> > I tried to export a vector file to use it in another application. The
> > module returns an error message that says "Unable to create OGR
> > spatial reference". The detailed output is here:
> >
> >     v.out.ogr input=MDG_UNSALB_admin3_selectionSN5 at PERMANENT
> >     output=/home/amit/Documents/mdg_aoi2_.gpkg
> >     ERROR 10: Pointer 'hSRS' is NULL in 'OSRImportFromWkt'.
> >     ERROR: Unable to create OGR spatial reference
> >
> >
> > Projection info
> >
> >     g.proj -p
> >     -PROJ_INFO-------------------------------------------------
> >
>
> I would guess that this is the problem:
>
> >     name       : unknown
> >     datum      : wgs84
> >     ellps      : wgs84
> >     proj       : aea
> >     lat_0      : 0
> >     lon_0      : 25
> >     lat_1      : 20
> >     lat_2      : -23
> >     x_0        : 0
> >     y_0        : 0
> >     no_defs    : defined
> >     towgs84    : 0.000,0.000,0.000
> >     -PROJ_UNITS------------------------------------------------
> >     unit       : meter
> >     units      : meters
> >     meters     : 1
> >
> >
> > I cannot figure out where I am wrong. Can you suggest an alternative?
>
> How did you initially create the GRASS Location? Is the albers equal
> area projection described by a standard EPSG code? It appears to be this
> one:
>
> https://epsg.io/102022
>
>
> **IF** that's the correct projection, then you should be able to do:
>
>
> echo
> "PROJCS["Africa_Albers_Equal_Area_Conic",GEOGCS["GCS_WGS_1984",DATUM["WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Albers_Conic_Equal_Area"],PARAMETER["False_Easting",0],PARAMETER["False_Northing",0],PARAMETER["longitude_of_center",25],PARAMETER["Standard_Parallel_1",20],PARAMETER["Standard_Parallel_2",-23],PARAMETER["latitude_of_center",0],UNIT["Meter",1],AUTHORITY["EPSG","102022"]]"
>
> | g.proj -c wkt=-
>
>
>
> That long WKT string will reset the projection definition of the
> Location, then you should be able to export OK.
>
>
> >
> > _______________________________________________
> > grass-user mailing list
> > grass-user at lists.osgeo.org
> > https://lists.osgeo.org/mailman/listinfo/grass-user
>
> --
> Micha Silver
> Ben Gurion Univ.
> Sde Boker, Remote Sensing Lab
> cell: +972-523-665918
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20220404/6139fb4a/attachment.html>


More information about the grass-user mailing list