postgresql - postgis shape文件导入问题

标签 postgresql gis postgis shapes shapefile

您好,我正在尝试从

导入一个形状文件

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)
...

对于纽约市的分数,这非常离谱..我做错了什么?

最佳答案

点数不是的。引用的空间数据不是纬度/经度。这就是为什么数字与您期望的不同。如果您需要它在 long/lat 中,则必须重新投影。在这里查看更多信息:http://postgis.refractions.net/news/20020108/

数据的投影好像是在NAD_1983_StatePlane_New_York_Long_Island_FIPS_3104_Feet坐标系(根据元数据 - 请参阅代码。)。

<spref>
    <horizsys>
        <planar>
            <planci>
                <plance Sync="TRUE">coordinate pair</plance>
                <coordrep>
                    <absres Sync="TRUE">0.000000</absres>
                    <ordres Sync="TRUE">0.000000</ordres>
                </coordrep>
                <plandu Sync="TRUE">survey feet</plandu>
            </planci>
            <mapproj><mapprojn Sync="TRUE">Lambert Conformal Conic</mapprojn><lambertc><stdparll Sync="TRUE">40.666667</stdparll><stdparll Sync="TRUE">41.033333</stdparll><longcm Sync="TRUE">-74.000000</longcm><latprjo Sync="TRUE">40.166667</latprjo><feast Sync="TRUE">984250.000000</feast><fnorth Sync="TRUE">0.000000</fnorth></lambertc></mapproj></planar>
        <geodetic>
            <horizdn Sync="TRUE">North American Datum of 1983</horizdn>
            <ellips Sync="TRUE">Geodetic Reference System 80</ellips>
            <semiaxis Sync="TRUE">6378137.000000</semiaxis>
            <denflat Sync="TRUE">298.257222</denflat>
        </geodetic>
        <cordsysn>
            <geogcsn Sync="TRUE">GCS_North_American_1983</geogcsn>
            <projcsn Sync="TRUE">NAD_1983_StatePlane_New_York_Long_Island_FIPS_3104_Feet</projcsn>
        </cordsysn>
    </horizsys>
</spref>

如果您经常使用空间数据,我建议您阅读更多关于 map projection 的内容.

关于postgresql - postgis shape文件导入问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7134389/

相关文章:

postgresql - 使用 Google Cloud SQL 重置 pg_stat_statements

postgresql - 将 Postgresql 数据转换为 Open Street Maps

postgresql - 使用 activerecord-postgis-adapter 并且点未转换为球形

ruby-on-rails - 数据库 :migrate:reset doesn't work with environment variables

postgresql - 如何在 Spring Data JPA 实体和通过继承相关的表之间进行映射

java - 执行快速 GPS 查找的数据结构?

javascript - 在 OpenLayers 3 中使用平铺的 Google map

r - 导出带有空间信息的复合 RGB 图像,R

javascript - 计算 2 个纬度/经度之间道路折线上的距离

sql - 如何使用 pl/pgSQL 处理 'comma separated list' 返回?