2013-02-15 84 views
0

我不確定這是否是正確的地方問這個問題,但我認爲我會給它一個鏡頭。我有一個導入到PostGIS中的世界地圖shapefile文件和我在測試表中添加的幾個點。這些應該在英國,但他們只是在馬達加斯加的海岸附近。我已經清楚地做了錯事,但看ogrinfo兩個表,我得到:PostGIS定位錯誤

Layer name: countries 
Geometry: 3D Multi Polygon 
Feature Count: 525 
Extent: (-180.000000, -89.999933) - (180.000000, 84.134162) 
Layer SRS WKT: 
GEOGCS["WGS 84", 
    DATUM["WGS_1984", 
     SPHEROID["WGS 84",6378137,298.257223563, 
      AUTHORITY["EPSG","7030"]], 
     AUTHORITY["EPSG","6326"]], 
    PRIMEM["Greenwich",0, 
     AUTHORITY["EPSG","8901"]], 
    UNIT["degree",0.0174532925199433, 
     AUTHORITY["EPSG","9122"]], 
    AUTHORITY["EPSG","4326"]] 
FID Column = gid 
Geometry Column = geom 
scalerank: Integer (2.0) 
featurecla: String (32.0) 
name: String (254.0) 
namealt: String (254.0) 
region: String (50.0) 
subregion: String (50.0) 


INFO: Open of `PG:dbname=g4wd' 
     using driver `PostgreSQL' successful. 

Layer name: test 
Geometry: 3D Point 
Feature Count: 2 
Extent: (51.009400, -2.638900) - (51.571400, 0.695600) 
Layer SRS WKT: 
GEOGCS["WGS 84", 
    DATUM["WGS_1984", 
     SPHEROID["WGS 84",6378137,298.257223563, 
      AUTHORITY["EPSG","7030"]], 
     AUTHORITY["EPSG","6326"]], 
    PRIMEM["Greenwich",0, 
     AUTHORITY["EPSG","8901"]], 
    UNIT["degree",0.0174532925199433, 
     AUTHORITY["EPSG","9122"]], 
    AUTHORITY["EPSG","4326"]] 
Geometry Column = location 
id: Integer (0.0) 
name: String (25.0) 

所以我以什麼我應該檢查很困惑。有沒有人知道我需要檢查或做什麼,因爲所有的prj信息似乎是正確的?

編輯:添加了geometry_columns詳細信息 - 不確定是否相關。

g4wd=# select * from geometry_columns; 
f_table_catalog | f_table_schema | f_table_name | f_geometry_column | coord_dimension | srid |  type  
-----------------+----------------+--------------+-------------------+-----------------+------+-------------- 
g4wd   | public   | test   | location   |    2 | 4326 | POINT 
g4wd   | public   | countries | geom    |    2 | 4326 | MULTIPOLYGON 

回答

0

test需求的座標數據被轉置(Y,X) - >(X,Y)中,由於軸順序爲PostGIS的(以及大多數其他GIS軟件)爲經度,緯度(而不是其他辦法!)。

如果這個數據已經被加載,交換使用此SQL update語句軸順序:

UPDATE test SET 
    location = ST_SetSRID(ST_MakePoint(ST_Y(location), ST_X(location)), 4326); 
+0

非常感謝。 – 2013-02-23 22:09:31