2

I am using New York's PLUTO lot data in QGIS for a project.

Right now, the shp file automatically imports with a custom CRS, allowing it to visually line up with a separate layer of subway entrances (with that subway layer using WGS84).

That all works fine visually, with both layers overlaying each other on my map.

However, when I attempt to do some analysis in python on my PLUTO features via print feature.geometry().centroid().asPoint() I find that instead of a lat/lon pair, I get a weird set of x/y coordinates with values in the hundreds of thousands.

I assume that this is related to some sort of "state plane" or "local plane" coordinate reference system.

What I would rather see is a set of coordinates closer to lat 40 and lon -73.

Is there any way to convert my PLUTO layer so it will act more like a WGS84 layer?


Here is the CRS that gets displayed in the "Layer Properties" dialogue box: Selected CRS (USER:100000, * Generated CRS (+proj=lcc +lat_1=40.66666666666666 +lat_2=41.03333333333333 +lat_0=40.16666666666666 +lon_0=-74 +x_0=300000 +y_0=0 +ellps=GRS80 +towsgs48=... (at which point the screen cuts off the extended text).


Simply using the "save as" dropdown on the layers palette to resave the layer as a WGS84 shapefile does not solve this problem. The new shapefile generated by that process still imports with a custom CRS, and analysis of that generated shapefile still returns coordinates like x:997248.532881, y:221815.926017. So this does not seem to be a duplicate of the flagged-as-duplicated problem.

  • Could you provide a pair of wgs84 coordinates and the corresponding "weird" coordinates? – til_b Oct 7 '16 at 12:22
  • I guess you are taking data from www1.nyc.gov/site/planning/data-maps/open-data/…. Can you discribe which dataset, and which shapefile from that you are taking? The CRS is NAD83 / New York Long Island (ftUS) EPSG:2263 – AndreJ Oct 7 '16 at 12:29
  • Hi AndreJ -- thanks for the comment. On the PLUTO page you linked, I am clicking "MapPLUTO - Manhattan (Shapefile)" and then downloading that file. I then use the shapefile MNMapPLUTO.shp to create my layer. – Patrick Oct 8 '16 at 7:28
  • Hi til_b -- thanks for the comment. For an address that sits near 40.775468, -73.953222 (according to Google Maps), I get the following: Address: 1592 2 AVENUE x: 997248.532881 y: 221815.926017 – Patrick Oct 8 '16 at 7:34
  • Mystery solved -- see comments on selected answer. – Patrick Oct 8 '16 at 12:54
4

I just tested with MNMapPLUTO.shp from http://www1.nyc.gov/assets/planning/download/zip/data-maps/open-data/qn_mappluto_16v1.zip in QGIS 2.16 and 2.17 and I cannot reproduce your issue.

  1. Open Shapefile in empty project
  2. Save as ... new CRS
  3. Resulting file/layer is in WGS84

If I'd have to guess: Don't change the CRS in the original layer's properties to WGS84. That would mess things up!

  • Looks like the "empty project" part of that was the important bit. Having the original project be empty seems to have done the trick. Thanks very much, underdark (and also thanks to everybody else who worked on this). – Patrick Oct 8 '16 at 12:48
2

In the export/Save data dialogue of QGIS you can set the output coordinate system. Right-click on the layer, select "save as" and in the dialogue set the CRS via the "choose crs" button on the right hand side of the dropdown. There you can choose WGS84, probably you'll need EPSG:4326 (hint: type 4326 in the filter box).

  • Thanks. The program appears to ignore the CRS I select in that dialogue box -- the exported file simply imports with the same custom CRS that the original file had possessed. Which is too bad, because it felt like you were on the right track. I really appreciate the info. – Patrick Oct 7 '16 at 12:04
  • Does this also happen with a fresh qgis project? So export to <file>_wgs84.shp, create new empty qgis project, import <file>_wgs84.shp. Then look at the x and y coordinates, maybe by creating a label for the layer using the expression concat($x_at(0) ,' ' , $y_at( 0 ))? That way you'll see the coordinates from the layer (because maybe your code is getting confused by differences between project crs and layer crs!). – til_b Oct 7 '16 at 12:10
  • another useful label expression is x(centroid($geometry)) || ' ' || y(centroid($geometry)) , and you don't really need the concat then. – til_b Oct 7 '16 at 12:26
  • Hi til_b -- Thanks for suggesting that I try this on a fresh project. Unfortunately, I still get a "Generated CRS" listing in my "Layer Properties" dialogue box, even when the layer is imported into a brand new project. – Patrick Oct 8 '16 at 7:45
  • Mystery solved -- see comments on selected answer. – Patrick Oct 8 '16 at 12:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.