2014-01-31 33 views
1

我想transfrom低於grometry(地理參考澳大利亞)幾何改造中的Spatialite 4.1.1

POLYGON(( - 33.917172 151.110971,-33.916443 151.112495,-33.917637 151.113276,-33.917783 151.111512 - 33.917253 151.111577,-33.917172 151.110971))

從SRID 4326到3112中spatiali使用以下查詢

SELECT AsText(Transform(PolygonFromText('POLYGON((-33.917172 151.110971,-33.916443 151.112495,-33.917637 151.113276,-33.917783 151.111512,-33.917253 151.111577,-33.917172 151.110971))',4326),3112)) as result 

te GUI 1.7.1 with spatialite 4.1.1啓用所有GEOS,PROJ擴展但生成的幾何爲

POLYGON((Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf)

這是怎麼發生的?

回答

1

非常簡單,你只需要翻轉LON/LAT值:

SELECT AsText(Transform(PolygonFromText('POLYGON((151.110971 -33.917172, 151.112495 -33.916443, 151.113276 -33.917637, 151.111512 -33.917783, 151.111577 -33.917253, 151.110971 -33.917172))',4326),3112)) as result 

結果:

POLYGON((1569305.481332 -3926985.759663, 1569455.307825 -3926925.091727, 1569508.606645 -3927065.382207, 1569345.639225 -3927059.314561, 1569359.502478 -3927002.182676, 1569305.481332 -3926985.759663)) 

http://en.wikipedia.org/wiki/Well-known_text

POLYGON(x y) = POLYGON(lon lat)