How to Plot Polygons on a Map

Hello,

Please how can I plot polygons on a map. I need this functionality in my wxPython app.

I can display the map (an OpenStreet Map) but I also need to plot polygons based on data (e.g lat/long, azimuths etc) imported into the tool.

Sample screen shot is attached.

Here’s the sample code I used to display the map in the screenshot:

def CreateHTMLCtrl(self):

ctrl = wx.html2.WebView.New(self)

ctrl.LoadURL(“http://www.openstreetmap.org”)

self.htmlctrl = ctrl

return ctrl

Thanks.

Austin

sample_screenshot.PNG

austin aigbe wrote:

Please how can I plot polygons on a map. I need this functionality in
my wxPython app.

I can display the map (an OpenStreet Map) but I also need to plot
polygons based on data (e.g lat/long, azimuths etc) imported into the
tool.

Your question is vastly more complicated than you imply here. You're
not just displaying a map. You are rendering a web page that happens to
display a map, but a map that is generated on the fly using Javascript
code. From wxPython, you don't have any way to know which pixels on the
map correspond to what physical locations. You can't even tell the scale.

The OpenStreetMap thing has an API that allows you to display things on
the map. THAT is the correct approach. Use their API, don't try to
reverse engineer it from wxPython.

···

--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.