[FWTools] OGR2OGR QUOTES ISSUE

Susana Iraiis Delgado Rodriguez susana.delgado_s at utzmg.edu.mx
Thu Oct 7 11:19:06 EST 2010


Hello members!

I'm running a python script to execute an ogr2ogr command. The process has
been sucessful, but now I want to create a shp for each layer a shp has. I
now I must use the command :
ogr2ogr newX.shp -where "LAYER = 'layerValueX'" original.shp
The code for the subprocess is as follows:
for line in open("unico.txt", "r").readlines():
  p = subprocess.Popen([C:/Archivos de programa/FWTools2.4.7/bin/ogr2ogr',
line+'.shp',
' -where', '\"LAYER= \'line\'\"', b+'.shp'])unfortuanely wtih this code the
module reads the variable line, which as the value of the layer has a string
"line": The problem is located after the word LAYER, I don't have idea about
the properly way to write the quotes.

Hope you can help, regards!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/fwtools/attachments/20101007/947f6c7a/attachment.htm 


More information about the FWTools mailing list