<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2523" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hi, I am Graham, living in Brisbane Australia.
Certainly not an IT professional but I hope that ogr2ogr can help me do
some basic edits to a large number of shapefiles.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I have a batch file as below (presently
sitting in the FW tools\bin foldeer to eliminate any path issues while I get it
working.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I am trying to update a shapefile called
temp.shp</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>That is, I want to open temp.shp and
edit it such that only records where the field called FEAT_CODE = "sea"
remain. Ideally I will update the original file but if ogr2ogr can create
another shapefile called temp2.shp then that is OK too.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>In the same folder I have the four components of
the shapefile, i.e </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>temp.shp</FONT></DIV>
<DIV><FONT face=Arial size=2>temp.prj</FONT></DIV>
<DIV><FONT face=Arial size=2>temp.dbf</FONT></DIV>
<DIV><FONT face=Arial size=2>temp.shx</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>If anyone can give me a couple of pointers to get
me started I would really appreciate it.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Thanks in advance,</FONT></DIV>
<DIV><FONT face=Arial
size=2>
Graham B</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>ogr_ops.bat</FONT></DIV>
<DIV><FONT face=Arial size=2>========</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>echo off</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>rem ogr2ogr [-skipfailures] [-append] [-update] [-f
format_name]<BR>rem
[-select field_list] [-where
restricted_where]<BR>rem
[-spat xmin ymin xmax
ymax]<BR>rem
[-a_srs srs_def] [-t_srs srs_def] [-s_srs
srs_def]<BR>rem
[[-dsco NAME=VALUE] ...]
dst_datasource_name<BR>rem
src_datasource_name<BR>rem
[-lco NAME=VALUE] [-nln name] layer [layer ...]]</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>echo off</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>rem call ogr2ogr -update -f "ESRI Shapefile"
-where(FEAT_CODE =sea) temp.shp temp2.shp</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>call ogr2ogr </FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>pause</FONT></DIV></BODY></HTML>