Carson and Magnus, thank you for answering.

When I load this shapefile into QGis, the CRS dialog indicates that it is EPSG code 4326 :
(+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs ).

That is the default value set in QGis preferences for layers that don't have projection information, and not the same as the information in the .prj file. Apparently the .prj file is not being read??


When I load the shapefile into R using readOGR(), I get:

 proj4string(nycb)
[1] " +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 +datum=NAD83 +to_meter=0.3048006096012192 +no_defs +towgs84=0,0,0"


In both QGis and R, the shapefile displays in the projected coordinate system, not lat/long.

 bbox(nycb)
        min       max
r1 912287.1 1067382.5
r2 116411.4  273617.8

I have since learned how to use spTransform() in R to convert to lat/long, i.e.,

new <- spTransform(nycb , CRS(" +proj=longlat +ellps=GRS80 +datum=NAD83 +no_defs +towgs84=0,0,0"))

 bbox(new)
         min       max
r1 -74.25875 -73.70001
r2  40.48608  40.91766


Going back to QGis, after that little side trip to R:

I tried saving to EPSG code 4269 (+proj=longlat +ellps=GRS80 +datum=NAD83 +no_defs), but it had no effect that I can see. For example, I load the saved shapefile into QGis, and it overlays exactly on the original.

Note that what Carson suggested is the same as what I used in R's spTransform(), except for the +towgs84 string.

At this point I'm at a loss...

-Don

At 8:37 PM +0000 3/25/09, Carson Farmer wrote:
Hi Don,
I would like to be able do the reverse operation. That is, "unproject" this shapefile and use the Save as Shapefile dialog to make a copy that is in lat/long.
Just search by name in the projection selection dialog for nad83, and I think you'll find the projection you're looking for... which is likely: epsg 4269.

Now you should be able to do the same as before, but you will be changing to a geographic CRS, namely, NAD83...

Hope that helps...

Carson

--
Carson J. Q. Farmer
ISSP Doctoral Fellow
National Centre for Geocomputation (NCG),
John Hume Building,
National University of Ireland, Maynooth,
Co. Kildare,
Ireland.
Phone: +353 (0) 1 708 6726
Fax:   +353 (0) 1 708 6456
Email: [email protected]
Web:   http:// www. carsonfarmer.com/
      http:// www. ftools.ca/


At 10:58 PM +0100 3/25/09, Magnus Homann wrote:
Don MacQueen skrev:

I would like to be able do the reverse operation. That is, "unproject" this shapefile and use the Save as Shapefile dialog to make a copy that is in lat/long.

When you save the shapefile, save it to the WGS 84 "projection" (i.e. CRS). EPSG code is 4326.

I hope that helps!

Magnus


--
--------------------------------------
Don MacQueen
Environmental Protection Department
Lawrence Livermore National Laboratory
Livermore, CA, USA
925-423-1062
--------------------------------------
_______________________________________________
Qgis-user mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/qgis-user

Reply via email to