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

Micha Silver tsvibar at gmail.com
Mon Apr 4 04:03:03 PDT 2022


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



More information about the grass-user mailing list