ToGeoJson and ToWKT for the Esri FGDB API

In support of some of our ongoing PIM work, we’ve been integrating the Esri File Geodatabase (FGDB) API into some tools. Without going into a level of detail that would hijack this post, one of the many functions performed by some of the tools is to validate physical spatial databases against established data models to analyze compliance and identify differences. These databases may be in Esri or non-Esri formats and we have traditionally handled Esri geodatabases through ArcObjects since it provides a relatively uniform interface across the various flavors of geodatabase.

Of course, ArcObjects requires an ArcGIS license of some sort and we are finding out that this is not always available to users in the field under many situations so the FGDB API gets past that for file geodatabases, at least. Continue reading “ToGeoJson and ToWKT for the Esri FGDB API”

Using GeoIQ Analytics in .Net Applications

A few weeks ago, I posted about some .Net wrappers I created for the GeoIQ API. Due to ongoing project work, I have continued to extend them by adding methods to wrap GeoIQ analytical capabilities. Despite the recent acquistion of GeoIQ by Esri, it’s my understanding that GeoCommons and existing GeoIQ installations will continue for some time. That’s good, because analytics on the GeoIQ platform are powerful and fairly easy to use. This post will demonstrate how to use analytics in a .Net application.

As previously posted, the .Net wrappers can be found on github here.

The GeoIQ platform offers several functions to analyze data sets hosted on a GeoIQ instance or GeoCommons. I have not yet wrapped all of the functions but am working my way through them as I can.

For this post, I will intersect the locations of US GISPs as of 1/26/2011 with the Maryland Zip Code Boundaries to produce a data set containing the locations of GISPs in Maryland, depicted in the map below.

Don’t worry, none of these are me.

Continue reading “Using GeoIQ Analytics in .Net Applications”

GeoIQ API Wrappers for .Net

A while back, I built a small interface between GeoIQ/GeoCommons and ArcGIS Desktop. From there, it became more of a full-fledged toolbar for ArcGIS. During that effort, I began developing some .Net classes to wrap the GeoIQ RESTful API. As we progressed with the toolbar, my colleague Hugo Estrada also contributed to the library.

The original intent was to wrap the entire API but it turns out that we were undertaking this in the middle of GeoIQ’s upgrade to version 2.0. In the intervening time, we got some projects implementing the GeoIQ platform for end users (such as the Climascope portal that Andrew Turner recently blogged about). Continue reading “GeoIQ API Wrappers for .Net”

MapWindow Open-Source Conference Coming Up

Thanks to Twitter, I see that the 3rd annual MapWindow Open-Source GIS Conference is coming up at the end of June. It is being held in Velp, The Netherlands. I call this conference out because it has a strong, but not exclusive, concentration on open-source GIS tools for the .Net environment, such as DotSpatial, SharpMap, and NTS. Additionally, there will be content on non-.Net tools such as PostGIS, OpenLayers and others. This makes sense as any complete stack usually contains a mix of technologies. PostGIS is almost the de facto standard back-end for open-source geo stacks and QGIS is probably the best open-source editor for it so inclusion of such tools is quite necessary.

MapWindow

For a number of reasons, I can’t attend but I’ll be watching the live stream with interest. It’s location in Europe makes a lot of sense. I’ve always noticed that my early posts on SharpMap get a large portion of traffic from Europe and a majority of the user base of zigGIS was European so I suspect there is a lot of demand there for open-source tools built on .Net. This conference could be a good one-stop shop if you are interested in such tools.

A Couple of Updates

Shortly after my previous post, about browsing and downloading data from GeoCommons, hit the wires, I got quite a few back-channel requests for the code. I sent it out via e-mail to a number of people and then posted it via DropBox. I have finally gotten around to posting it up on Google Code, making things much more manageable. It is now available here.

I have made a few updates since the original post. Some were administrative but were functional. They are:

1. The code was updated to replace SharpZipLib with DotNetZip for handling zip files.
2. The code now attempts to identify the default KML handler on the user’s system and pass KML directly to it for previewing.
3. The user now gets a wait cursor when the tool is processing downloads and such. This should make it a little more usable.
4. The code headers had been pasted in from SharpMap and I missed some references to SharpMap in the text. Those have been corrected.

Anyway, thanks for all the interest. It sort of caught me off guard but at least the code is more accessible now. I’ve got a few more updates planned so this should streamline things.

Importing Data From GeoCommons Into ArcMap

UPDATE: The code for this post is available at the bottom of the page.

I have been doing a lot of development with the ESRI Silverlight API recently. One of the requirements of my project is to be able to dynamically add KML data at runtime. The incorporation of KML was handled for us through one of the ESRI samples on the resource center so we pretty much just had to integrate that code and test against our use cases. For testing, I typically reached out to GeoCommons since any data set available there can be streamed as KML.

Obviously, this is not my first exposure to GeoCommons but, when discussing it, I found that many of the analysts I spoke with were not aware of it and did not use it much. So I decided to tackle developing a simple ArcMap extension to allow a user to search GeoCommons and then download/add data to ArcMap without the need to manually download, unzip and add the data themselves. Continue reading “Importing Data From GeoCommons Into ArcMap”

Integrating ASP.NET with Drupal in the Acquia Stack

A while back, I posted this about running SharpMap on Apache. At the time, the ability to run ASP.NET on Apache was mainly a curiosity to me but had little practical value. Recently, I had the need to revisit this technique for a project. I used the same post I had used previously as a reference, although the comment by Carlos there was more up-to-date and served me well this time.

This time, we were migrating an old custom-built site to the Drupal CMS. The old site was a mixture of ASP Classic and ASP.NET. Drupal is a PHP-based CMS. Due to the deadline for completing the migration, there were two ASP.NET applications that we planned to leave in place. They automated custom workflows and our schedule didn’t allow for rewriting them. Drupal had been installed as part of the Acquia stack installer that includes Apache, PHP, Drupal and MySQL.

Following the instructions I had used previously, I integrated mod_aspdotnet in the Apache http.conf. I made the following entries, as instructed (these are sample entries for purposes of this post).

AspNetMount /SampleASP "c:/SampleASP"
Alias /SampleASP "c:/SampleASP"

These entries mount the ASP.NET application where it sits physically and alias it to a virtual directory in Apache. Having done this before, I was not worried. This time, however, it did not work. After some research, I realized that these directives were in conflict with some mod_rewrite entries that are part of the stack installer. They are:


ServerName localhost
RewriteEngine On
RewriteOptions Inherit
RewriteCond %{REQUEST_URI} !/acquia-drupal.*
RewriteCond %{REQUEST_URI} !/phpmyadmin.*
RewriteRule ^(/.*)?$ /acquia-drupal$1

In this case, any URI that does not look like http://${hostname}/acquia-drupal is rewritten to match that format. So my URI of http://${hostname}/SampleASP was being rewritten as http://${hostname}/acquia-drupal/SampleASP which does not exist and promptly fails. The solution to this problem was to modify the AspNetMount and Alias entries above to this:

AspNetMount /acquia-drupal/SampleASP "c:/SampleASP"
Alias /acquia-drupal/SampleASP "c:/SampleASP"

This redirected properly and the ASP.NET executed. So, the lesson here is that, if you choose to use a stack installer, make sure you understand the customizations that the installer makes to the products it includes.