开发者

Reversed Latitude/Longitude US Tiger/Line Shape File to MySQL w/ OGR2OGRP

开发者 https://www.devze.com 2023-02-01 14:32 出处:网络
I\'ve downloaded the latest set (2010) of TIGER edge shape files (ESRI shapefile format) from the US Census website and am loading them into MySQL using the GDAL ogr2ogr utility.A new table (geotest)

I've downloaded the latest set (2010) of TIGER edge shape files (ESRI shapefile format) from the US Census website and am loading them into MySQL using the GDAL ogr2ogr utility. A new table (geotest) does get created with a SHAPE column that has the geometry defined as a LINESTRING. However, I am seeing reversed latitude and longitude values that get reversed when running the following command:

ogr2ogr -f "MySQL" MySQL:"geo,user=myuser,host=localhost,password=mypwd" -nln geotest -nlt LINESTRING -append -a_srs "EPSG:4326" -lco engine=MYISAM tl_2010_01021_edges.shp

Mapping the latitude/longitude (after reversing them of course) they appear to be spot on so I suspect there is just something I am doing wrong or flag I am missing which is causing the latitude and longitudes to be transposed.

When I select the SHAPE column using astext() I get the following result:

LINESTRING(-86.69863 32.973164,-86.69853 32.97302,-86.69856 32.97287,-86.698613 32.972825,-86.6988 32.972825,-86.6989 32.972892,-86.6989 32.973002,-86.69874 32.97316,-86.69864 32.97318,-86.69863 32.97开发者_JAVA百科3164)

Any ideas what I am doing wrong?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号