Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QGIS writing out incorrect .prj file #16341

Closed
qgib opened this issue Mar 16, 2013 · 7 comments
Closed

QGIS writing out incorrect .prj file #16341

qgib opened this issue Mar 16, 2013 · 7 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Projections/Transformations Related to coordinate reference systems or coordinate transformation

Comments

@qgib
Copy link
Contributor

qgib commented Mar 16, 2013

Author Name: Gavin Fleming (@gubuntu)
Original Redmine Issue: 7368
Affected QGIS version: master
Redmine category:projection_support


QGIS 1.9 nightly build

Save a layer as a shapefile in EPSG 3857 and different prj and qpj files are written out. The prj file is inadequate. I picked this up when using the output shapefile as a gdalwarp cutline and the output raster cut was shifted by several kilometres. gdalwarp reads the prj file, not the qpj file. I renamed the qpj file to .prj and this solved the problem.

.prj:

PROJCS["WGS_84_Pseudo_Mercator",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Mercator"],PARAMETER["central_meridian",0],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["Meter",1],PARAMETER["standard_parallel_1",0.0]]

.qpj:

PROJCS["WGS 84 / Pseudo-Mercator",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]],PROJECTION["Mercator_1SP"],PARAMETER["central_meridian",0],PARAMETER["scale_factor",1],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["X",EAST],AXIS["Y",NORTH],EXTENSION["PROJ4","+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext  +no_defs"],AUTHORITY["EPSG","3857"]]

@qgib
Copy link
Contributor Author

qgib commented Jan 18, 2014

Author Name: dr - (dr -)


Confirm such behavior on latest master.

@qgib
Copy link
Contributor Author

qgib commented Feb 21, 2014

Author Name: Chris Matthews (Chris Matthews)


I am also having trouble with the .prj file QGis is creating when working with 3857. I'm using Qgis 2.0.1

@qgib
Copy link
Contributor Author

qgib commented Feb 21, 2014

Author Name: Etienne Tourigny (@etiennesky)


confirmed. look like the ogr provider needs updating... probably too late to include this in 2.2 though! At least there is a workaround.

@qgib
Copy link
Contributor Author

qgib commented Feb 21, 2014

Author Name: Etienne Tourigny (@etiennesky)


Fixing this would require fixing QgsVectorFileWriter() and copying the .qpj file to .prj file.

@qgib
Copy link
Contributor Author

qgib commented Feb 21, 2014

Author Name: Jürgen Fischer (@jef-n)


Etienne Tourigny wrote:

Fixing this would require fixing QgsVectorFileWriter() and copying the .qpj file to .prj file.

Producing the .qpj is a workaround because OGR converts the SRS to ESRI WKT for the .prj (ie. "OSRMorphToESRI()":http://www.gdal.org/ogr/classOGRSpatialReference.html#aac948450b15fa3d8814ab440b9f705b7) and that's not lossless. QGIS prefers the .qpj with the original information over the .prj. Keeping the original information is the whole point of the .qpj.

@qgib
Copy link
Contributor Author

qgib commented Apr 30, 2017

Author Name: Giovanni Manghi (@gioman)


  • regression was configured as 0
  • easy_fix was configured as 0

@qgib
Copy link
Contributor Author

qgib commented Mar 9, 2019

Author Name: Giovanni Manghi (@gioman)


End of life notice: QGIS 2.18 LTR
*
Source:*
http://blog.qgis.org/2019/03/09/end-of-life-notice-qgis-2-18-ltr/


  • resolution was changed from to end of life
  • status_id was changed from Open to Closed

@qgib qgib closed this as completed Mar 9, 2019
@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! Projections/Transformations Related to coordinate reference systems or coordinate transformation labels May 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Projections/Transformations Related to coordinate reference systems or coordinate transformation
Projects
None yet
Development

No branches or pull requests

1 participant