<div>Hello:</div>
<div> </div>
<div>I'm new in the use of FWTools enviroment. I'm developing a python module that executes an ogr2ogr command. This module will ask the user to enter some parameters such as map names, layer names, etc. I already make my code to execute setfw and ogr2ogr, but when I enter the argument that points to tha original file, it shows me an error. I copied and pasted the code and the error. Hope you can help me. </div>
<div> </div>
<div>from dbf import *<br>from osgeo import ogr<br>import os<br>import sys</div>
<div>def call():<br> print "Ingresa el nombre para el nuevo mapa"<br> arg1 = "R1G-GEODESIA2.shp"<br> print arg1<br> print "Ingresa la condicion"<br> arg2 = "LAYER = 'R1G-GEODESIA'"<br>
print arg2<br> print "Ingresa el nombre del mapa original"<br> arg3 = 'tapalpa_05_plani_point.shp'<br> print arg3<br> os.system('"C:/Archivos de programa/FWTools2.4.7/setfw"')<br>
os.chdir('C:\Python26')<br> os.system('"C:/Archivos de programa/FWTools2.4.7/bin/ogr2ogr.exe"'+" " +"arg1" +" "+ "-where" +" "+ "arg2" +" " +"arg3"+"")<br>
call()</div>
<div>Traceback (most recent call last):<br> File "<stdin>", line 1, in <module><br> File "fw.py", line 20, in <module><br> call()<br> File "fw.py", line 18, in call<br>
os.chrdir('C:\Python26')<br>AttributeError: 'module' object has no attribute 'chrdir'<br>>>> import fw<br>Ingresa el nombre para el nuevo mapa<br>R1G-GEODESIA2.shp<br>Ingresa la condicion<br>
LAYER = 'R1G-GEODESIA'<br>Ingresa el nombre del mapa original<br>tapalpa_05_plani_point.shp<br>FAILURE:<br>Unable to open datasource `arg3' with the following drivers.<br> -> ESRI Shapefile<br> -> MapInfo File<br>
-> UK .NTF<br> -> SDTS<br> -> TIGER<br> -> S57<br> -> DGN<br> -> VRT<br> -> REC<br> -> Memory<br> -> BNA<br> -> CSV<br> -> NAS<br> -> GML<br> -> GPX<br> -> KML<br> -> GeoJSON<br>
-> Interlis 1<br> -> Interlis 2<br> -> GMT<br> -> SQLite<br> -> ODBC<br> -> PGeo<br> -> OGDI<br> -> PostgreSQL<br> -> MySQL<br> -> XPlane<br> -> AVCBin<br> -> AVCE00<br> -> DXF<br>
-> Geoconcept<br> -> GeoRSS<br> -> GPSTrackMaker<br> -> VFK<br></div>