0
Answer

Point within a polygon. Shape overlay GIS

Guerven

Guerven

20y
2.8k
1
I'm a VB.NET GIS programmer, I am developing a software that can overlay vector shapes or object on an orthorectified-( i mean it was orthorectified until I converted it to a smaller size image: from 500 MB down to 10MB) image. I was successful with the overlay. I used a picturebox and placed the JpegImage on it and then used its OnPaint method to overlay vectors from points. The picture box is then filled with polygons ( e.graphics.drawpolygon()) each polygon consist of around 300-500 points. and there is about 80 polygons at a time. The problem is, I want the polygons to be clickable. I succeeded in converting the polygons to usercontrols (using a usercontrol class and overriding its onpaint method and creating a region based on the polygon). HOWEVER, I can't use the same method when dealing with buildings because there would be thousands of polygons in the picturebox. I can overlay A thousand polygon(plain drawing) but not a thousand usercontrol object. Is there anyway that I could make those simple drawings clickable. I was wondering if I could calculate the center of the polygons and form a radius from it and I would have to determine if the X,Y that I clicked on the picture boxwould fall to one of those thousand polygon. But I don't know how to calculate for the center of an irregular polygon with irregulr shapes. I was thingking if there was a formula to determine whether a point is inside a complex polygon. But I can't find any answer on the net, don't know where to search. And then I would have to determine if the point I clicked is inside in one of those thousand polygons. pretty difficult huh, But I see them doing it in other GIS software. ei, you could tell me your ideas, if there is hope tell me. if there is no hope.. tell me also. if this is a sick idea, do tell me.