Pong

July 14th 2014, Geo-Spatial Coordinate Conversions

July 14th 2014 SQLite R-Tree Module | | July 15th 2014 R-Tree Example

Our next goal is to test the R-Tree module of SQLite. As this involves geo-spatial coordinate conversions, we prepare ourselves with a tool that allows us to convert easily between various map projections.

For example let’s consider the Eiffel-Tower. Is is located at the geographic coordinate (48.858701,2.294573), meaning it has a geographic latitude of 48,86 degrees (angle above equator) and a geographic longitude of 2.29 degrees (angle west of the Greenwich Meridian).

To find out a geographic coordinate, right-click at a point in Google Maps and select “What is here?”. Then the geographic coordinate shows up as two comma separated angles in the Google Maps search line.

How do we transform LatLon (or LL) coordinates into other common geo-spatial coordinates like UTM and ECEF? We could use the “gdal_transform” tool of GDAL, but for ease of use we go for the “coord” tool of libMini: It converts LLH into ECEF, ECEF into UTM, and UTM back into LLH.

We build the tool as follows:

svn co http://svn.code.sf.net/p/libmini/code/libmini/mini mini
cd mini
make
sudo make install

The libMini “coord” tool reads a coordinate from the standard output and prints the converted coordinate to standard output. An example:

echo “LL(48.858701,2.294573)” | coord

yields

ECEF(4200912,168327.5,4780237)

And

echo “ECEF(4200912,168327.5,4780237)” | coord

yields

UTM(448257.7,5411988,2.500043,31)

And so on…

So the Eiffel Tower falls within UTM zone 31 and is located 4780 km “above” the equatorial plane.

July 14th 2014 SQLite R-Tree Module | | July 15th 2014 R-Tree Example

Options: