Friday, November 6, 2015

Extending Python 3.x (online resource)

Who doesn't love C++/C, I sure do....

Here is a great guide to developing all your c/c++ extension here (https://docs.python.org/3.4/extending/).

Happy Coding!

Great Blog to Follow (Dan Patterson's GeoNet Blog)

If you have used any ArcGIS software over the years, and asked a question on the Esri or GeoStackExchange Forums you have probably encountered Dan Patterson.  He has a great blog, which is full of knowledge any programmer, cartographer or GIS analyst should know.

I don't know the man, but I love reading his posts.  I am sure you will too.

The web address is: https://geonet.esri.com/blogs/dan_patterson

Enjoy.

Tuesday, October 27, 2015

Monday, August 31, 2015

The Walking Metadata (hermes example)

The hermes Python package was released (v1) last week, and now I'm going to show how to read the values instead a given metadata file from a feature class.

import hermes
if __name__ == "__main__":
    fc = r"c:\data_and_maps\usa\census\blkgrp.sdc\blkgrp"
    paperwork = hermes.Paperwork(dataset=fc)
    data = paperwork.convert()
    for k,v in data.iteritems():
        print k, v

In this example, I access the dataset, in this case a feature class.  To convert the metadata to a dictionary, call the convert().  Then you can use the dictionary iterator object to walk the data.

This example is just going to show something like:

metadata {some dictionary value}


Enjoy!

Friday, August 28, 2015

Work with metadata check out hermes

So you have to work with metadata? Or you love paperwork, or you just hate using the Python XML packages? Give hermes a try. It is named after And inspired by Hermes Conrad from Futurama. It is a simple set of tools to translate the Xml to a Python dictionary. Check it out here: http://github.com/Esri/hermes Fork it, follow it, improve it. I'll be posting a couple of usage examples over the next few weeks. I look forward to everyone's feedback.

Monday, August 3, 2015

ArcREST (v3 beta) manageorg update

On the current master branch, the ArcREST team is up to some good old fashion reworking in the hopes of making life a bit easier when working with portal and AGOL.

In today's push (8/3/2015). The big update is the manageorg sub package is changed to make the user's content iterable.

Let's check out an example:

import arcrest
admin = arcrest.manageorg.Administration(url=url,
                                         securityHandler=sh)
user = admin.content.users.user("ARandomUserAccount")
for item in user.items:
    print item.id, item.access, item.owner, item.ownerFolder
    for k in item:
        print k
You'll notice two really interesting things. We are accessing a site with a token handler sh, then we use the for loop syntax to loop through all the items in the root folder. Also, the UserItem object, which is returned from the iterator off of user.items also returns Key/Value pairs from the raw JSON. This means you can get really find grained information from the object, not just what is stubbed out in the class objects. I would like some feedback on this. It was tons of code changes, and wanted to make sure I didn't drop any functions anyone really needed. Enjoy!

Friday, July 24, 2015

A Big Thank You And ArcREST Documentation Update!

I want to thank everyone for attending my session.  It was great to hear what you are doing, and what you want to do with ArcREST, as well as just meeting all of you.  It was exciting to know that I was able to make your workday a little easier and hopefully you can REST a bit better knowing that this package is there to help you out!

I have a lot more work flows to hammer out and ideas to get working on now that I spoke to the users!

While flying back to my home, I pushed out new documentation for the v3.0.0 ArcREST, which can be found here (https://github.com/Esri/ArcREST/tree/master/docs)  If you clone the repository, the HTML documentation is pulled down.  So update your forks, or re-pull the code to get the latest documentation.  I must admit though, I am not the best with Sphinx and Latex, so it's bear bones.

Please feel free to contact me on the issue's page here, or submit a pull request to help make the help documentation look better.

Thank you for attending Esri's UC 2015, attending the ArcREST demo theater presentation, or just talking to me at the developer island.  It was a lot of fun to interact with everyone and see all the awesome things people are doing.

Keep on mapping!
~A