Skip to main content
Question

How do you create geometry from an array of coordinates?

  • Nov 15, 2022 4:25 PM UTC
  • 2 replies
  • 268 views

fme_hans
Contributor
Forum|alt.badge.img+6

Hi,

I have array with geometry type and coordinates. How can I easily make geometry out of it? I could make a wkt text with string replace but I suspect it could be easier.

 

The string with geometry type and coordinates is (shortened):

{"type":"MultiPolygon","coordinates":[[[[155469.406,463438.624],[155469.253,463444.217],[155467.196,463444.174],[155467.077,463444.172],[155462.4]4,408. [ 155469.406,463438.624]]]]}

 

 

2 replies

david_r
Celebrity
  • Nov 15, 2022 4:32 PM UTC

Looks like GeoJSON, so I would first try the GeometryReplacer set to parse it as such.


fme_hans
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • Nov 16, 2022 7:27 AM UTC

Hi,

 

It is indeed GeoJson. I had put a wrong attribute in the geometry replacer and that's why it didn't work. Now that I put the right attribute in the geometry replacer, geometry is created. Thanks.