cancel
Showing results for 
Search instead for 
Did you mean: 

Geo map shape layer covers the whole map

jmsrpp
Advisor
Advisor
0 Kudos

Hi,

I've tried this in Design Studio 1.5 and Design Studio 1.6 and am left scratching my head. I've created a geojson file SERVICE_CONFLICTS.json that tests correctly at geojsonlint.com but when I add it to a shape layer, the entire map is filled in as chloropleth with the shapes I've defined excluded!

The tooltip shows on all of the map except for the shape in question:

Any ideas what might be causing the component to behave the exact opposite of what I'd expect?

Accepted Solutions (1)

Accepted Solutions (1)

mike_howles4
Active Contributor
0 Kudos

Trace your polygons in the other direction.  The left-hand vs right-hand rule problem is at play.

jmsrpp
Advisor
Advisor
0 Kudos

Hey Mike,

That worked ... any reference on what the left-hand/right-hand rule is? I could only find Fleming's law on Google. I'm generating around 650 polygons automatically with HANA spatial engine so I'm not sure how to handle this at scale. It would be nice to adjust Design Studio to handle this instead since it works on principal with geojsonlint.

I appreciate your help!

Jim

mike_howles4
Active Contributor
0 Kudos

I'd ask this guy here:

Per his comment here:

Per your issue with HANA spatial generating the polys, good question.  I assume you could run it thru a GeoJSON tool maybe and see if it just naturally re-orders them.  But I'm not sure.

More left/right hand/foot info here:

area - How do different GIS systems determine a Polygon's interior? - Geographic Information...

jmsrpp
Advisor
Advisor
0 Kudos

More good info ... it begs the question why HANA spatial is generating these polygons following left-hand rule definition. I'll have to follow up and see if I can just batch process these polygons to invert their order in the short-term. The link you provided on stackexchange says that GeoJSON does not specify an order, which is probably why it works on geojsonlint.

mike_howles4
Active Contributor
0 Kudos

Yeah, it would be more intuitive if both of the SAP tools implemented the same GeoJSON rules, as loose as they may be. 

jmsrpp
Advisor
Advisor
0 Kudos

Just to close the loop on this ... I just used Excel to invert the order of the polygons, as changing it in HANA was too intensive for me. The spatial reference guide has a section in the appendix called:

CREATE SPATIAL REFERENCE SYSTEM

That details a property called POLYGON FORMAT

Internally, SAP IQ interprets polygons by looking at the orientation of the constituent rings. As one travels a ring in the order of the defined points, the inside of the polygon is on the left side of the ring. The same rules are applied in PLANAR and ROUND EARTH spatial reference systems. The interpretation used by SAP IQ is a common but not universal interpretation. Some products use the exact opposite orientation, and some products do not rely on ring orientation to interpret polygons. The POLYGONFORMAT clause can be used to select a polygon interpretation that matches the input data, as needed. The following values are supported:

  • CounterClockwise – Input follows SAP IQ's internal interpretation: the inside of the polygon is on the left side while following ring orientation.
  • Clockwise – Input follows the opposite of SAP IQ's approach: the inside of the polygon is on the right side while following ring orientation.
  • EvenOdd – (default) The orientation of rings is ignored and the inside of the polygon is instead determined by looking at the nesting of the rings, with the exterior ring being the largest ring and interior rings being smaller rings inside this ring. A ray is traced from a point within the rings and radiating outward crossing all rings. If the number the ring being crossed is an even number, it is an outer ring. If it is odd, it is an inner ring.

It seems that the EvenOdd default setting in my case is resulting in a left-hand orientation. I suspect that changing the property to Clockwise might alter the orientation, but I'm not willing to tackle creating a new spatial reference system and reloading my data.

0 Kudos

Hi James,

I have a similar issue with my polygons, however not all of mine are "wrong".  When you converted your polygons, did you find a way to "convert" them all to right-hand only if necessary, or did you just "reverse" all of them, knowing that they were left-hand?

I have about 1900 polygons, which would be time-intensive to recreate.  I'm trying to find a tool that will convert them all to the correct format.

thanks,

Paul B.

jmsrpp
Advisor
Advisor
0 Kudos

Hi Paul,

In my case I had a colleague use Excel formulas to simply reverse the order of all my polygons. The same behavior occurred uniformly across 100% of the shapes, so it was easy to handle. Do you have any other feature properties associated with the shapes that you could use to filter the inverted ones out? That would make it easier to batch process.

Jim

Answers (0)