Bug report #673

msexport creates wrong LAYER PROJECTION

Added by jmckenna-dmsolutions-ca - over 13 years ago. Updated about 11 years ago.

Status:Closed
Priority:Low
Assignee:nobody -
Category:-
Affected QGIS version: Regression?:No
Operating System:Windows Easy fix?:No
Pull Request or Patch supplied: Resolution:fixed
Crashes QGIS or corrupts data: Copied to github as #:10732

Description

In my test case, I set a custom projection in QGIS for the map, however the msexport utility outputs a mapfile with the LAYER PROJECTION set to latlong for some reason (the MAP PROJECTION object is correctly set to the custom projection).

If there is no way in QGIS to set a LAYER projection, then the msexport utility should just use the projection from the project properties for the mapfile's MAP projection object, and then not include any projection objects at the layer level.

test.qgs - project file with 1 layer and a custom MAP projection (10.9 KB) jmckenna-dmsolutions-ca -, 2007-03-20 03:01 PM

History

#1 Updated by Gary Sherman over 13 years ago

Can you provide (attach) the .qgs file? My tests indicate that layer PROJECTION sections are written out properly.

#2 Updated by jmckenna-dmsolutions-ca - over 13 years ago

why is 'sourcesrs' set to latlong?

#3 Updated by anonymous - over 13 years ago

That's the default map projection if you don't specify one. Try setting the projection using Project Properties. If you have already done that, try setting the default projection for QGIS using the Projection tab under Options. Then save your project file and see if sourcesrs is correct. Sounds like the bug is either in the project output code, or the python mapserver export script.

#4 Updated by jmckenna-dmsolutions-ca - over 13 years ago

I already set a custom projection in the Project Properties, so I also set the "Global default projection" in Options to this same custom projection...but the 'sourcesrs' in the .qgs file is still set to latlong for some reason.

Is it possible that I am not setting these projections properly? (is sourcesrs set correctly for other people?)

#5 Updated by Gary Sherman over 13 years ago

The sourcesrs should be the same as the SRS for the layer. In your sample, province2.shp is in WGS84 (4326). Is this true? The destination SRS is your projected coordinate system. In the map file I exported, it had the map projection set properly and defined the layer projection as WGS84. This is correct, assuming province2.shp is actually in WGS84.

#6 Updated by jeffmckenna-gmail-com - over 13 years ago

This bug has to do with this source SRS being incorrectly set: here is part of my original entry into this bug:

"In my test case, I set a custom projection in QGIS for the map, however the msexport utility outputs a mapfile with the LAYER PROJECTION set to latlong for some reason (the MAP PROJECTION object is correctly set to the custom projection)."

province2.shp is in the custom projection that I mentioned (not latlong), yet msexport assigns a latlong projection to the LAYER incorrectly.

I would assume that the msexport utility would output the custom projection to the mapfile's MAP projection object (which it does correctly), and then outputs no LAYER projection in my case.

#7 Updated by Gary Sherman almost 13 years ago

  • Status changed from Open to Closed
  • Resolution set to fixed

I think this is fixed. Due to some internal constraints, the PROJECTION section is always written out for the layer but should be correct.

#8 Updated by Anonymous about 11 years ago

Milestone Version 0.9.1 deleted

Also available in: Atom PDF