Converting XYZ data to units suitable for a .KML

2,715 views
Skip to first unread message

rubared

unread,
Nov 16, 2006, 2:47:11 PM11/16/06
to KML Discussions
Hi, on a whim I went ahead and purchased some data from Mapmart in .XYZ format, I am looking to traingulate then produce contours and the contour line segments stored in a KML for display in GE (which I think should be a feature of GE, but that's a different story..).

My question is, how do I convert the X & Y values (below) to units suitable for a KML (if it is not in a suitable format already)

The data I received is in this format:
Code:

Projection GEOGRAPHIC
Datum WGS84
Zunits NO
Units DD
Xshift 0.000000
Yshift 0.000000
Parameters



and a sample is, (the '0' has been truncated off the x values, they should all read .360):
Code:

206673.36|-73455.637|808.927
206673.36|-73458.637|807.905
206670.36|-73455.637|802.96
206670.36|-73464.637|801.662
206673.36|-73461.637|800.797
206673.36|-73452.637|799.412
206676.36|-73458.637|798.109
206676.36|-73455.637|797.982
206673.36|-73464.637|792.952
206670.36|-73467.637|792.493

Chris198

unread,
Nov 16, 2006, 3:31:54 PM11/16/06
to KML Discussions
Hi there,

Welcome to the community!

If you have a look at this pdf...

http://www.ordnancesurvey.co.uk/oswebsit...eat_Britain.pdf

It explains in detail all about the different coordiate systems, if you go to page 41, you will see how to convert them easily, hope that helps

Chris

rubared

unread,
Nov 16, 2006, 5:44:14 PM11/16/06
to KML Discussions
Thanks for the link, but after having read it, I am still at odds with the data I have. Apparently the data is in Decimal Degrees (in ddmmss.sss format ?), which after a small conversion, GE should accept in a .KML, but given the bounds of data I have, they appear to be nowhere near Mauritius (which is the location of data I purchased)

Could anyone clarify a newbie on this?

Code:

sqlite> select min(x) , max(x), min(y), max(y) from points;
206190.36|208209.36|-73950.637|-71901.637

JKurtock

unread,
Nov 16, 2006, 8:16:10 PM11/16/06
to KML Discussions
First, to try to answer your questions:

"Geographic" projection means you are getting pure latitude and longitude. (Contrasted, e.g., with UTM where the coordinates are in meters. Sort of.) DD probably means decimal degrees, which means NO minutes and seconds (i.e., 42 degrees 15 minutes = 42.25 in decimal degrees). This is good; GE uses geographic data in decimal degrees.

Next, what do you think you bought? I'm going to guess you bought NED (National Elevation Data) data, where the x and y just form a continuous grid (probably 1/3 second spacing), and the Z coordinate is the altitude in meters. (Above sea level, not from the center of the earth.)

So your data looks suspiciously like Haiti, not Mauritius, but that's really a WAG (wild a__ guess).

Third, what are you trying to do? If you have the latitude and longitude of a point, Google Earth can give you the altitude (in meters or feet, your choice). You want to automate the process, and get the altitude for lots of points? You should consider the magic of the Google Earth COM API!

Can you give us more info?

- Jeff

zonums

unread,
Nov 16, 2006, 8:41:35 PM11/16/06
to KML Discussions
hi

You can import your data into an Excel sheet. I have a tool that will take your coordinates as Lat/Long or UTM and create KML files.


The tool is free and it is available for download at

http://www.zonums.com/excel2GoogleEarth.html

rubared

unread,
Nov 17, 2006, 6:18:37 AM11/17/06
to KML Discussions
Hi Jeff,
Thanks for the explanation on the Coords.

I bought "SRTM-90 DEM" (http://www.mapmart.com/DEM/DEM.htm#International) in ".XYZ ASCII grid format."

The elevation data is definately of Mauritius, I quickly imported it into their Global Mapper product and the 'shape/surface' looks ok. The only thing I cannot understand is why the x & y coordinates (seem to) refer to somewhere which is clearly not where Mauritius is located. I think I will drop them an email...

What I am trying to do, well, good question, I am planning a path through the undergrowth (got to do something during my Feb 2007 holiday apart from being on the beach), and printing this off using GE. So contour lines would definately be useful on this printout (via a KML), so I decided I could do it myself. But before I triangulate & contour, it would be helpful if my x & y data actually are where they are supposed to be

I also came across the COM API too late, if the data I have is useless, then I wiill probably investigate that instead.

Chris198

unread,
Nov 17, 2006, 6:39:56 AM11/17/06
to KML Discussions
SRTM 90, or SRTM 3 as its formally known as is free and can be downloaded off an ftp server...

ftp://e0srp01u.ecs.nasa.gov/srtm/version2/

Available there is 3 resolutions, SRTM 1 (30 metre res) SRTM 3 (90 metre res and SRTM 30 (1km res). SRTM 3 and SRTM 30 are available for most of the world, where as SRTM 1 is just for the US.

Anyway, back to the coordinates, i have to say the XY format there is very weird, i just can't work out what coordinates they are, they look like UTM, not degrees decimal, but they do not give mauritius lat lon when you convert them!

rubared

unread,
Nov 17, 2006, 9:39:37 AM11/17/06
to KML Discussions
Humm, I am glad now I only paid $15US for it, and it's a shame that they provided something no one seems able to decrypt.

Anyway, I have sent them an email and I'll follow up once they clarify which point they are measuring from.

Thanks.

rubared

unread,
Nov 21, 2006, 7:59:08 PM11/21/06
to KML Discussions
Update; I got an email back from them to download a new set of data and the lat/long look a lot better
Code:

57.40926667,-20.40436667,809.0
57.40926667,-20.4052,807.9976043
57.40843333,-20.40436667,802.99800104



I got no explanation for the previous data.
Here is an example of the contours I generated:
Contours Example

Now time to do battle with that KML spec!

Chris198

unread,
Nov 22, 2006, 6:52:18 AM11/22/06
to KML Discussions
Thats much better! I have no idea what they managed to do on those last set of coordinates! lol

noktek

unread,
Nov 22, 2006, 4:20:17 PM11/22/06
to KML Discussions
You can convert x,y,z to KMZ by the following URL.

xyz to KMZ
Reply all
Reply to author
Forward
0 new messages