gvSIG bugs #4548

Error when adding layers with user CRS

Added by Mario Carrera almost 7 years ago. Updated over 6 years ago.

Status:Closed% Done:

0%

Priority:NormalSpent time:-
Assignee:-
Category:CRS
Target version:-
Severity:Minor Add-on version:
gvSIG version:2.4.0 Add-on build:
gvSIG build:2825 Add-on resolve version:
Operative System: Add-on resolve build:
Keywords: Proyecto:
Has patch: Hito:
Add-on name:Unknown

Description

There's an error when adding layers with user CRS. The steps are:

- We create a View with a user CRS.
- We create a new layer in that View.
- After saving it, we add that layer in that View (from Add layer menu)

The CRS indicated in the "Add layer" window is an EPSG (not USR) and it indicates "Reprojected-on-the-fly". If we accept, the layer is loaded in the ToC but it doesn't appear in the View, even selecting an element on the Table and pressing "Zoom to selection" tool. Zoom is in 0,0 coordinates.

gvSIG.log (455 KB) Mario Carrera, 07/20/2017 12:08 PM

History

#1 Updated by Antonio Falciano almost 7 years ago

Hi Mario,
can you attach a gvSIG.log file? What kind of error happens?
I can reproduce the error with an User CRS of mine, even if it depends by the specific user CRS you are using.

ERROR 246533 Thread-23 org.gvsig.crs.proj.CrsProj - Can't create CRS from ''.
org.gvsig.crs.proj.CrsProjException: Error creating CRS
    at org.gvsig.crs.proj.CrsProj.createCrs(CrsProj.java:107)
    at org.gvsig.crs.proj.CrsProj.<init>(CrsProj.java:63)
    at org.gvsig.crs.Crs.getCrsProj(Crs.java:545)
    at org.gvsig.crs.COperation.<init>(COperation.java:146)
    at org.gvsig.crs.Crs.getCT(Crs.java:600)
    at org.gvsig.fmap.mapcontext.layers.FLayers.doAddLayer(FLayers.java:171)
    at org.gvsig.fmap.mapcontext.layers.FLayers.addLayer(FLayers.java:234)
    at org.gvsig.fmap.mapcontext.layers.FLayers.addLayer(FLayers.java:194)
    at org.gvsig.fmap.dal.serverexplorer.filesystem.swing.FilesystemExplorerWizardPanel$2.run(FilesystemExplorerWizardPanel.java:306)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.RuntimeException: OGR Error: Corrupt data
    at org.gdal.osr.osrJNI.SpatialReference_ImportFromProj4(Native Method)
    at org.gdal.osr.SpatialReference.ImportFromProj4(SpatialReference.java:535)
    at org.gvsig.crs.proj.CrsProj.createCrs(CrsProj.java:105)

Is it your case? Can you also attach the user crs row created in gvSIG/plugins/org.gvsig.projection.app.jcrs/db/usr.script? It can be useful in order to reproduce the issue.

#2 Updated by Mario Carrera almost 7 years ago

Hi Antonio,

I attach log file.

I have applied a CRS that I had previously. I added it from WKT text given by a user at the mailing list, at this topic: http://osgeo-org.1560.x6.nabble.com/Problema-con-GVSIG-y-proyeccion-INEGI-Mexico-td5325898.html .

The CRS user row is:
INSERT INTO USR VALUES

The problem has been sent to the Spanish mailing list today: http://osgeo-org.1560.x6.nabble.com/HELP-cual-es-la-logica-td5328472.html

#3 Updated by Antonio Falciano almost 7 years ago

Mario Carrera wrote:

Hi Antonio,

I attach log file.

Thanks for your prompt reply.

I have applied a CRS that I had previously. I added it from WKT text given by a user at the mailing list, at this topic: http://osgeo-org.1560.x6.nabble.com/Problema-con-GVSIG-y-proyeccion-INEGI-Mexico-td5325898.html .

The WKT reported in this topic:

PROJCS["ITRF_1992Lambert_Conformal_Conic",GEOGCS["GCS_ITRF_1992_1",DATUM["D_ITRF_1992",SPHEROID["GRS_1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Lambert_Conformal_Conic"],PARAMETER["Central_Meridian",-102],PARAMETER["Latitude_Of_Origin",12],PARAMETER["False_Easting",2500000],PARAMETER["False_Northing",0],PARAMETER["Standard_Parallel_1",17.5],PARAMETER["Standard_Parallel_2",29.5],PARAMETER["Scale_Factor",1],UNIT["Meter",1]]

should be recognized as EPSG:6362 (Mexico ITRF92 / LCC). This is the ESRI WKT from gdalsrsinfo:

PROJCS["Mexico_ITRF92_LCC",GEOGCS["GCS_Mexico ITRF92",DATUM["D_Mexican_Datum_of_1993",SPHEROID["GRS_1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Lambert_Conformal_Conic"],PARAMETER["standard_parallel_1",17.5],PARAMETER["standard_parallel_2",29.5],PARAMETER["latitude_of_origin",12],PARAMETER["central_meridian",-102],PARAMETER["false_easting",2500000],PARAMETER["false_northing",0],UNIT["Meter",1]]

so there are some discrepancies about PROJCS, GEOGCS and DATUM name, which make difficult to OGR to recognize it with AutoIdentifyEPSG. I suggest the user to update the WKT in projection files.

The CRS user row is:
INSERT INTO USR VALUES

The problem has been sent to the Spanish mailing list today: http://osgeo-org.1560.x6.nabble.com/HELP-cual-es-la-logica-td5328472.html

Instead, there aren't other useful elements in this topic. However, I've submitted a patch to improve the prj recognition (#4531) that should fix the most part of these issues.

#4 Updated by Álvaro Anguix over 6 years ago

  • Status changed from New to Closed

Also available in: Atom PDF