Posts Tagged ‘ ESRI ’

ESRI makes it (kinda) easy to move data around via Spatialite

With the release of ArcGIS 10.2 ESRI added support for Spatialite databases.  You can’t directly edit Spatialite data, but you can create a new database, import data into one, and export data from one.  You can even create new feature classes in a database along with new tables and views.  These features make Spatialite databases a great way to move data from organization to organization.

There isn’t a way though the GUI to create a spatialite database, but it only takes three lines of ArcPy code.

import arcpy

out_path = 'C:/Data/Test.sqlite'

arcpy.gp.CreateSQLiteDatabase(out_path, 'SPATIALITE')

If you use the Python Geoprocessing window you can get it down to two lines by skipping the import statement.  If you skip the optional ‘SPATIALITE’ parameter Arc will store the geometry in ESRI’s native ST_Geometry format, which shuts out people using OSGeo software, so please use the ‘SPATIALITE’.

Once your database is created you can use ArcCatalog to import data into it, export data from it, create a new table, create a new view or a new feature class.  You can view your data in ArcGIS, or view and edit your data with QGIS and other OSGeo GIS platforms, or you can use the spatialite GUI.

Advertisements

Displaying PostGIS data in ArcGIS Desktop

There are a few ways to display PostGIS data in an ArcGIS Desktop map.  The easiest I’ve found is to use Ragi Burham‘s OGR Plugin for ArcGIS.  It allows you to bring in data from almost any OGR supported vector format, including PostGIS and Spatialite.  For right now the layers you bring in will be read-only but according to the project’s FAQ write support will be added thanks to new features in ArcGIS Desktop 10.1 SP1.

The project is in Beta and there are some rough corners.  To connect to your PostGIS database you have to provide a connection string, there is no GUI for this as of yet.  For now though, the example connection string under the field where you type in your information is a very good guide on what information you need and how it needs to be formatted in order to create a connection.  Once you bring in your layers they act like any other vector layer, except they are read-only.  The only problem I’ve found so far is labels aren’t placed correctly.

On the bright side this plugin allows you to use your PostGIS vector layers as base layers for data creation and editing.  You can use ArcGIS’s snapping and trace features as if the layers were a native shapefile or feature class and for cartography purposes you can symbolize your layers by category or quantity.

Overall this plugin is a great addition, a simple way to integrate OSgeo data, and other OGR supported data into your maps.

 

UPDATE: Map documents don’t store the connection information, so if you save a mxd and open it later the connections to your PostGIS layers will be broken.

You need ArcInfo for this? Seriously?

I had two line layers and needed to create points at where the layers intersected.  In QGIS this is done with the line intersection tool found in the Vector -> Analysis Tools menu.  Just give it the two input layers, name an output layer and you’re done.  As near as I can tell with ESRI tools you have to spring for ArcInfo so you can use the Feature to Lines tool as specified in this Ask the Cartographer post.