postgis形状文件导入问题
您好,我正在尝试从
http://www. nyc.gov/html/dcp/html/bytes/bytesarchive.shtml
到 postgis 数据库中。当我使用 shp2pgsql 导入时,上述文件会创建 MULTIPOLYGONS。
然后我试图简单地确定纬度/经度点是否包含在我的多边形中,
但是我的选择不起作用,当我打印出 the_geom 列的点时,它似乎非常损坏。
select st_astext(geom) from (select (st_dumppoints(the_geom)).* from nybb where borocode =1) foo;
给出结果...
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)
...
对于纽约的积分,这是非常错误的..我做错了什么?
Hi I'm trying to import a shape file from
http://www.nyc.gov/html/dcp/html/bytes/bytesarchive.shtml
into a postgis database. the above files creates MULTIPOLYGONS when i import using shp2pgsql.
then i'm trying to simply determine if lat/long points are contained in my multipolygons
however my select's are not working, and when i print out the poitns of my the_geom column it seems to be very broken.
select st_astext(geom) from (select (st_dumppoints(the_geom)).* from nybb where borocode =1) foo;
gives the result...
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)
...
for points in nyc, this is very off.. what am i doing wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
点都不是的。所引用的空间数据不是纬度/经度。这就是为什么数字与您的预期不同的原因。如果您需要它是长/纬度,则必须重新投影。在此处查看更多信息:http://postgis.refractions.net/news/20020108/
投影数据似乎位于 NAD_1983_StatePlane_New_York_Long_Island_FIPS_3104_Feet 坐标系(根据元数据 - 请参阅代码。)。
如果您经常使用空间数据,我建议您阅读有关地图投影的更多信息。
The points are not of. The spatial data that is referred to is NOT in lat/long. This is why numbers are different from what you expect. If you need it to be in long/lat it must be reprojected. See more here: http://postgis.refractions.net/news/20020108/
The projection of the data seems to be in the NAD_1983_StatePlane_New_York_Long_Island_FIPS_3104_Feet coordinate system (according to the metadata - see code.).
If you work much with spatial data I suggest that you read more about map projection.
我认为这不是 PostGIS 的问题。我使用 AvisMap Free Viewer 检查了输入 esri Shape 文件
nybb.shp
并作为你看到点本身很奇怪:但是有一些有趣的东西
nybb.shp.xml
元数据文件:我不熟悉这些工具包(ESRI ArcCatalog),但很可能您需要在使用该元数据导入后重新调整点。
I think this is not issue with PostGIS. I checked input esri Shape file
nybb.shp
with AvisMap Free Viewer and as you see points are weird itself:However there is something interesting in
nybb.shp.xml
metadata file:I am not familiar with those toolkit (ESRI ArcCatalog), but most probably you need to rescale your points after import using that metadata.