Skip to main content
Question

Decoded an encoded polyline

  • September 13, 2014
  • 4 replies
  • 187 views

Forum|alt.badge.img

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

takashi
Influencer
  • September 13, 2014
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?

Forum|alt.badge.img
  • Author
  • September 13, 2014
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.

 

 

 

 


gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • September 15, 2014
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.

gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • September 15, 2014
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)

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings