Bug report #5058
Invalid CRS when the newly created shapefile has a different CRS than the project
|Affected QGIS version:||master||Regression?:||No|
|Operating System:||Windows||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:||worksforme|
|Crashes QGIS or corrupts data:||Yes||Copied to github as #:||14828|
Running v1.7.3 'Wroclaw' on 64 bits windows 7 machine.
Using one CRS for my project (WSG-84 UTM 33N EPSG:32633) I figured it would be nice to create a shapefile with polygons in plain WSG84-lat/lon (EPSG:4326). No special reason for it, just a whim. However, the projection of new shapefile projection was a total screwup.
Here's what I find with ogrinfo -summary
Layer name: test1_originalSRS Geometry: Polygon Feature Count: 3 Extent: (516090.757943, 7524045.000971) - (716205.736382, 7703464.547432) Layer SRS WKT: GEOGCS["GCS_WGS_1984", DATUM["WGS_1984", SPHEROID["WGS_1984",6378137,298.257223563]], PRIMEM["Greenwich",0], UNIT["Degree",0.017453292519943295]]
As you can see, the Extent is in what looks like UTM coordinates (and assuming zone 33N they are where I expect them to be). Those coordinates don't mix very well with WGS-84 projection parameters... Using UTM (meters) where you expect degrees will clearly produce bogus.
For your amusement I've uploaded a screenshot of what it looks like when you import the new shapefile into Qgis. That's EPSG:4326 like you've never seen it before!
Additional information: code rev. 00624b3, GDAL/OGR v 1.8.1, postgreSQL client v. 8.3.10, spatiaLite v 2.4.0, QWT v 5.2.1.
#4 Updated by Giovanni Manghi over 9 years ago
Just tested to create a new polygon shapefile in WGS84 in a EPSG 32633 project, and the result seems fine in qgis-master
Storage type of this layer: ESRI Shapefile
Source for this layer: C:/Users/gio/Desktop/teste.shp
Geometry type of the features in this layer: Polygon
The number of features in this layer: 1
Editing capabilities of this layer: Add Features, Delete Features, Change Attribute Values, Add Attributes, Create Spatial Index, Fast Access to Features at ID, Change Geometries
In layer spatial reference system units : xMin,yMin -1.21177,-0.0946221 : xMax,yMax -0.228924,0.683721
Layer Spatial Reference System:
+proj=longlat +datum=WGS84 +no_defs
Can you please test qgis-master and see if it works fine for you? Thanks