Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

i downloaded a shape file 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 waaay off for NYC

                st_astext                 
------------------------------------------
 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?

share|improve this question

1 Answer 1

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;
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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