Question

Decoded an encoded polyline

  • 13 September 2014
  • 4 replies
  • 30 views

Badge

Hi, I'm still quite new to FME and I'm trying to figure out how to decode an series of polylines that were encoded using the Google Encoded Polyline Algorithm Format.

https://developers.google.com/maps/documentation/utilities/polylinealgorithm

 

 

The encoded polylines are currently stored in a CSV file and I am using the GeometryReplacer to decode the encoded polyline which appears to work when inspecting the results for the IFMEline coordinates, however the geometry shows up as a straight line. I'm not sure if I need to perform further transformation to decode this correcty. Any ideas?

 

 

 


4 replies

Userlevel 2
Badge +17
Looks like a straight line, but you can see that there are many vertices if you look at the Feature Information window of Data Inspector. Are the coordinates wrong?
Badge
Yes, the coordinates are correct. I've compared the decoding using the Google Polyline Encoder/Decoder tool. https://developers.google.com/maps/documentation/utilities/polylineutility

 

 

I am expecting a polyline South to North.

 

 

 

 

Badge +3
Hi,

 

 

I trie it out.

 

 

according to description it is LL, so in my case as i live in Holland i needed to use reprojector to reproject to RD_new.

 

If i do the shape looks like in the Google Api, if dont it does'nt (of course)

 

 

So u need to use Reprojector on it.
Badge +3
addendum:

 

 

I also noticed that you need to use chopper and then linejoiner to join them.

 

 

In my case i made a (supposedly) closed line (to use by areabuilder) in the Google API, but it would not form an area.

 

Only after chopping to 2 vertices and subsequently Linejoining it formed an area. (no snapping required)

 

Reply