I downloaded a shapefile from the Dept. of city planning of NYC

I use shp2pgsql to create a table (nybb)

I use http://prj2epsg.org/search to determine my srid is 2263. which I then set.

select updategeometrysrid(nybb, the_geom, 2263);

I then try to select all the lat long points using the following query

select st_astext(geom) from (select (st_dumppoints(the_geom)).* from nybb where borocode =1) foo;

but the results I get are way off for NYC

 POINT(1007193.83859999 257820.786899999)
 POINT(1007209.40620001 257829.435100004)
 POINT(1007244.8654 257833.326199993)
 POINT(1007283.3496 257839.812399998)
 POINT(1007299.3502 257851.488900006)
 POINT(1007320.1081 257869.218500003)
 POINT(1007356.64669999 257891.055800006)
 POINT(1007385.6197 257901.432999998)
 POINT(1007421.94509999 257894.084000006)
 POINT(1007516.85959999 257890.406100005)
 POINT(1007582.59110001 257884.7861)
 POINT(1007639.02150001 257877.217199996)
 POINT(1007701.29170001 257872.893099993)
 POINT(1007760.5337 257857.325499997)
 POINT(1007854.3688 257830.947600007)
 POINT(1007909.50319999 257819.490899995)

What am I missing?


You didn't transform the points. They are still in 2263. Add st_transform().

select st_astext(st_transform(geom,4326)) 
from (select (st_dumppoints(the_geom)).* from nybb where borocode =1) foo;

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.