Skip to main content
Solved

Create polygons from a string of coordinates

  • September 30, 2024
  • 6 replies
  • 90 views

ricardoa
Contributor
Forum|alt.badge.img+3

Hi there!

I want to create polygons from an attribute that contains a string of coordinates and other information. 

My problem is that I don't know how to only extract the coordinates from the string and then create the polygons by their ID attribute. 

 

The string in the coordinates attribute looks like this:

“{"type":"Feature","properties":{},"geometry":{"type":"Polygon","coordinates":[[[13.707920553133594,60.03475791657763],[13.708950521395312,60.03304306231432],[13.705474378512012,60.03160680337132],[13.702513219759567,60.02997753853561],[13.702255727694139,60.030577803349054],[13.703929426119434,60.03184261136259],[13.706161024019824,60.032571461785544],[13.707920553133594,60.03475791657763]]]}}”

 

ID attribute 1 to 10

 

Regards, 

 

Ricardo :) 

Best answer by nielsgerrits

ricardoa wrote:

Thank you @nielsgerrits !!!

Here is the file. 

Workspace sample attached.

 

View original
Did this help you find an answer to your question?

6 replies

nielsgerrits
VIP
Forum|alt.badge.img+54

You can create a geometry from this using the GeometryReplacer. Set it to Esri JSON. If that does not work you might need to extract the geometry part using the JSONExtractor. If you want me to create a sample workspace, you’ll need to attach complete source file.


ricardoa
Contributor
Forum|alt.badge.img+3
  • Author
  • Contributor
  • October 1, 2024

Thank you @nielsgerrits !!!

Here is the file. 


nielsgerrits
VIP
Forum|alt.badge.img+54
  • Best Answer
  • October 1, 2024
ricardoa wrote:

Thank you @nielsgerrits !!!

Here is the file. 

Workspace sample attached.

 


ricardoa
Contributor
Forum|alt.badge.img+3
  • Author
  • Contributor
  • October 2, 2024

Thank you @nielsgerrits 😃👍🏽😄


thomasmarti
Contributor
Forum|alt.badge.img+8
  • Contributor
  • October 7, 2024

Hi @nielsgerrits 

why did you use the FeatureReader instead of the Excel-Reader? What are the benefits of your solution?

 

Greets 

Tom


nielsgerrits
VIP
Forum|alt.badge.img+54
thomasmarti wrote:

Hi @nielsgerrits 

why did you use the FeatureReader instead of the Excel-Reader? What are the benefits of your solution?

 

Greets 

Tom

Hej Tom, this is personal preference. When the FeatureReader and FeatureWriter were introduced (in 2016?) I stopped using the classic Readers and Writers. I find them more intuitive to configure. All our teammembers use FME this way.


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