3

I want to use arcpy (the ESRI install of python 2.65) to analyse MapInfo TAB files...can this be done directly or do I need to convert them to shp files...if so would it be possible to do something like

tabs=glob.glob('*.tab') and then
for tab in tabs
 some function to convert tab to shp tab_shp1.shp 

(maybe ogr2ogr -f "ESRI Shapefile" mydata.shp mydata.tab) not sure how to call an external command line.

 shpObj=arcpy.Describe(tab_shp1)
 etc

I know there is functionality in FWTOOLS via OGR but can I access this via the ESRI python 2.65 install?

We have both tab and shp data and I am trying to create a master spatial index of all the datasets we have. I have written the code for ESRI formats but want to include the tab's if possible.

3

If you have OGR installed you should be able to use OGR in python.

import ogr
ds = ogr.Open("Path")

There is some explains of usinig Python OGR on here http://www.gdal.org/ogr/ogr_apitut.html

  • Thanks guys...haven't had time to evaluate the answers here. Will get back ASAP – GeorgeC Aug 23 '11 at 23:39
  • You'll need to ensure the ogr python bindings are installed for the same python that Arcgis is using. This recipe worked for Arcgis 9.3, I haven't tried anything similar for 10 yet. – matt wilkie Nov 9 '12 at 19:42
2

From the ArcGIS Resource Center:

Complexity: Beginner

Data Requirement: ArcGIS Tutorial Data Setup

Data Path: C:\arcgis\ArcTutor\Data Interoperability\

Goal: Learn how to work with nonnative datasets in ArcMap when the Data Interoperability extension is enabled. Direct-read formats are used directly from the Catalog tree as read-only datasets. When you add them to ArcMap, ArcScene, or ArcGlobe, all standard map functions are enabled, including attribute tables and labeling functions.

...

You can see the quick import tool as part of the data interoperability tools toolkit - This can also be batch processed.

  • 2
    Finding this resource is great, Hairy, but please follow standard practice for re-using material. It is of paramount importance to attribute other people's material, preferably with a link (which I have supplied). Furthermore, extracting large blocks of text is usually not acceptable: instead, provide the link and a summary (either in your own words or with selected quotations). For more information, please consult the site policy (section 3) and make sure to respect the copyright on the site you are citing (it appears at the bottom of the page). – whuber Aug 17 '11 at 13:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.