Public Safety GIS

11 Mar
My Custom Buttons

My Custom Buttons

ESRI has been promoting ArcGIS Online but I think their best, and least appreciated, product is ArcGIS Desktop Explorer. Besides being free, redistributable, and having a lot of built in functionality, it ships with a .NET SDK.

I have been playing with writing buttons to load multiple files from remote URLS, a button to launch websites, and a button to connect to an FTP site and grab the newest shapefile. My newest button is a data connection to MongoDB. It is written completely in C# and just displays all the data from a collection as notes.

I took this one step further, and because I had trouble figuring out $near in C# I wrote it in python, by only selecting the points near the current map views center, with a limit of 20 points.

The button onClick calls a python script and passes the current map center as an argument. The python script takes the sys.argv and queries the MongoDB and writes out a CSV. The button reads in the CSV and loads the points. I am really working to get the $near figured out in C# but had to make it work quickly.

I’m writing this on my phone and don’t have the code handy but if you are interested leave a comment and I will update this post with the C# and python. Think I’ll also write a post on calling python from C#.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: