Spatialite 4.1.1中的几何变换

时间:2014-01-31 06:33:01

标签: spatialite

我正试图从grometry下面转换(geo引用澳大利亚)

  

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使用以下查询

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

在spatialite GUI 1.7.1中,带有spaceite 4.1.1,所有GEOS,PROJ扩展已启用,但生成的几何图形

  

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

为什么会这样?

1 个答案:

答案 0 :(得分: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)