Skip to main content

 

I am working on Windows 7 (64- Bit). I have two Areas, Area 1 and Area 2 (State 1 and State 2). There is a road crossing through the boundary of the State i.e., horizontal line. So, horizantal line is both, the boundary of the state and the road. Both areas (states), have there specific Postal codes (PC). So, the problem is-

 

 

   At times (not always), Area 1 shows the Postal Code of Area 2 or/and vice-versa. (Vertical Line and Horizontal line). Basically, it depends on the start point. The road fetches postal codes and state names automatically from the area from where the digitization was started, disregarding of the location of the state.

 

 

For its solution i created the centroid of the road network segments, but it is creating points outside the road network.

 

 

Any other solutions for this in FME. 
HI,

 

 

For the centerpointcreation on linesegments i would not use this transformer. This is because it uses the bounding box of the feature, not the oreinted boundingbox apparently. Rounding may result in not exact being on the line.

 

 

 

You best extract the 1st and last point of each line and calculate the centre. That will ensure a point on the line. U can use the coordinate extractor for this.

 

index 0 for 1st point, name first_x, first_y.

 

index =-1 for the last, name last_x and last_y

 

Rest is basic math:

 

center_x=(last_x - first_x)/2

 

center_y=(last_y - first_y)/2

 

Create an ID for each segment using a counter (if u dont have an id for the segments).

 

 

Even better would be calculate the length of the line. Devide length by 2. And then use a snipper set at the calculated length. Then extract the last vertex. This point surely must be on the line...

 

 

Greets

 

Gio
Hi Gio,

 

 

Thanks a lot for the suggestion.

 

I tried it this way. The problem that came was that the point was having the attributes same as that of the polyline (Road). For my first problem, it did great and I got the solution by creating center point. But, unfortunately, didn't work for the second problem. So for that, I used LineOnAreaOverlay with List Name and then ListExploder. It created two different attributes for all the areas which had two features spatially. (:

 


Reply