<div dir="ltr"><br><br>
<div class="gmail_quote">On Thu, Aug 7, 2008 at 12:23 PM, D <span dir="ltr"><<a href="mailto:eloquence2@gmail.com">eloquence2@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div dir="ltr">
<div>Hi,</div>
<div> </div>
<div>I have a question about the usage of OGR2OGR in defining an ESRI Shapefile output name. I am exporting Spatial data from Oracle Spatial (11g) from a single table to an ESRI Shapefile and would like to get the following naming syntax for my Shapefile:</div>
<div> </div>
<div><br>[select distinct FIELD1 from SHEMA.TABLE][select distinct FIELD2 from SHEMA.TABLE][fixed value -> 01]</div>
<div> </div>
<div>.. the output would look like </div>
<div> </div>
<div>50000002806200701.shp</div>
<div>50000002806200701.shx</div>
<div>50000002806200701.dbf<br> <br>The naming parts/chunks that are concatenated here are actually queries in the source database (Oracle).</div>
<div> </div>
<div>Any examples (sample scripts, procedures) or hints on how to implement this, would be very helpful.</div>
<div> </div>
<div>Thanks!</div>
<div> </div>
<div>Best regards,</div>
<div>Dejan</div></div><br>_______________________________________________<br>gdal-dev mailing list<br><a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br><a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
</blockquote></div>
<div><br>Hi Dejan,</div>
<div> </div>
<div>I don't think it is possible using ogr2ogr.exe, you will need to write a small programme to do so. </div>
<div> </div>
<div>Sorry I have not written any script yet on such a issue. But you could what you could do is. </div>
<div> </div>
<div>Open a recordset and from the desired name in select statement</div>
<div> </div>
<div>select [select distinct FIELD1 from SHEMA.TABLE] || [select distinct FIELD2 from SHEMA.TABLE] || 01 from DUAL </div>
<div> </div>
<div>and then pass this into the command line parameter as string</div>
<div> </div>
<div>to from </div>
<div> </div>
<div>ogr2ogr.exe -f "ESRI Shapefile" <string from database result>.shp "OCI:xxxxxxx/xxxxxxx@dbname" -sql <select queries that you want the output from ></div>
<div> </div>
<div>and execute this thru shell or command prompt.</div>
<div> </div>
<div>Hope this helps...!!!</div>
<div> </div>
<div>Rgds.</div>
<div>Abhay.</div></div>