Python and MapObjects (Was: Python and ArcView GIS)

Bruce Dodson bruce_dodson.nospam at bigfoot.com
Wed Jan 12 23:23:56 EST 2000


I have tried that too.  It works fine if you only use it to script the
automation components, e.g. if you just use MO as a way to query and access
spatial data.  But I ran into trouble when I tried to instantiate the MO
control.  I was able to show a map in a window, using PythonWin's MFC-ish
classes, and it worked OK... but when PythonWin closed, Dr. Watson would
complain about access violations or something.  (That is on Windows NT.  On
my home machine, running Windows 95b, it closes without errors.)  I don't
know enough about PythonWin or MFC to track this down.

The other thing with MO is that, since it is a licensed control, it might
not deploy correctly.  I'm not sure how licensing works in COM, but I think
some keycode ends up embedded as a resource within the EXE.  Since a Python
program doesn't have that license information embedded in it, MO might
refuse to load.  I have not tested this; the problem might not even exist.

Attached is a very quick hack of the IE4 example for ActiveX.  Make a few
minor changes in Demo() to point it at a shapefile that exists on your
system, run it from pythonwin, and with any luck an MDI child will pop up
with a map in it.

Bruce

Allan Hollander wrote in message ...
>The ArcView extension sounds very interesting.
>
>Along these lines of interfaces to ESRI software, has anybody done any
>work with getting Python to talk to the MapObjects set of components?  I'd
>love to have some pointers on how to do this.  Right now I'm stuck on
>how to create/access/etc. the Map ActiveX control, which seems basic to
>getting much farther with this.
>
>desperately-trying-to-avoid-visual-basic y'rs --
>
> -- allan
>
>
>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: MapWindow.py
URL: <http://mail.python.org/pipermail/python-list/attachments/20000113/08acc5de/attachment.ksh>


More information about the Python-list mailing list