Kmz to XSLT

895
4
08-12-2016 05:54 AM
Highlighted
New Contributor

I am unsure how to create a block of coordinates from a Kmz file to the XSLT Format

I have a shapefile that I reproject into WGS82

I then perform the Layer to KML which produces the KMZ file for me.

I have been requested create XSLT files that converts the ESRI files into something usable for mobile mapping. They want a block of coordinates that looks like the following:

<Polygon><outerBoundaryIs><LinearRing><coordinates>-72.255271828977385,41.805559575004423 -72.254855745565052,41.805792445649189 -72.254797968855414,41.805750128745785 -72.254727780268979,41.805780132890206 -72.254653558486297,41.805804097205119 -72.254576230002399,41.8058217222369 -72.254496758005843,41.805832788823118 -72.254416131540452,41.805837158947035 -72.254335357066637,41.805834777502092 -72.254255441585926,41.80582567582104 -72.254177378233891,41.805809967112438 -72.254102142675563,41.805787845544558 -72.254148322091979,41.805708411735374 -72.254153256636229,41.80570956827161 -72.254087766116101,41.805687906297564 -72.254026587746409,41.805660066546658 -72.253970756420458,41.805626520755773 -72.253921218443836,41.805587836620774 -72.253878809942606,41.805544668699611 -72.253844249733717,41.80549774667648 -72.253818122554904,41.805447865384757 -72.253800869563619,41.8053958685596 -72.253685636505267,41.805405691504347 -72.253685424857437,41.805405202601158 -72.253670024305734,41.805353786343332 -72.253662757668494,41.805301375931201 -72.253663725316088,41.805248688482145 -72.253672914458548,41.805196446927894 -72.253690199250386,41.805145366509919 -72.253715342050484,41.80509614758175 -72.253747998326418,41.805049463926025 -72.25385125865516,41.80508165958134 -72.253953141355481,41.804974095767705 -72.253932664857032,41.804947474286315 -72.254048692311954,41.804881826052871 -72.254071283396243,41.804901979423789 -72.254232218860196,41.804848814616157 -72.254211036277937,41.80476204538229 -72.254285398152561,41.804747925557884 -72.254361483166932,41.804740557657603 -72.254438200294146,41.804740048640703 -72.254514447241363,41.804746405481353 -72.254589132100477,41.804759536161782 -72.254661184148674,41.804779253319921 -72.254729568286692,41.804805274311185 -72.254793304255614,41.804837225792184 -72.254707422859212,41.804889188077325 -72.254767084659193,41.804921258053099 -72.254821605382759,41.804958097655955 -72.254870306238359,41.804999249302519 -72.254912581048202,41.80504420079923 -72.254947905805992,41.805092394386456 -72.254975841056321,41.805143230349749 -72.255067146294166,41.805095798300044 -72.255078851413586,41.805097197196751 -72.255120723994608,41.805210760411988 -72.25512672350645,41.805309543596962 -72.25530392409803,41.805323001396061 -72.255446500471891,41.805452889800982 -72.255271828977385,41.805559575004423</coordinates></LinearRing></outerBoundaryIs></Polygon>

Does anyone have any insight on this?

Tags (2)
Reply
0 Kudos
4 Replies
Highlighted
MVP Regular Contributor

If you convert the KMZ back to KML (in Google Earth), you can open the KML with a text editor (e.g. Notepad) and will see that the polygon geometry is written in exactly the format you require.  Then you can just copy and paste the geometry to a new XSLT file.

Reply
0 Kudos
Highlighted
MVP Esteemed Contributor

or if you are python adept try convert *.kmz to *.kml

Highlighted
Esri Regular Contributor

If you have the Data Interoperability extension you can read the KMZ file and extract the geometry to KML XML specification, it will have namespace declarations which you may want to remove.

Highlighted
MVP Regular Contributor

Or you can unzip the KMZ, which is just a zip file with the KML file inside. The file you need is usually called 'doc.kml' - KMZ Files

Note: an XSLT is not a data format, it's an XML Stylesheet for translating between XML formats - XSLT