<div dir="ltr"><br><br>
<div class="gmail_quote">On Thu, Aug 7, 2008 at 12:23 PM, D <span dir="ltr">&lt;<a href="mailto:eloquence2@gmail.com">eloquence2@gmail.com</a>&gt;</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>&nbsp;</div>
<div>I have a question about the&nbsp;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>&nbsp;</div>
<div><br>[select distinct FIELD1 from SHEMA.TABLE][select distinct FIELD2 from SHEMA.TABLE][fixed value -&gt; 01]</div>
<div>&nbsp;</div>
<div>.. the output would look like </div>
<div>&nbsp;</div>
<div>50000002806200701.shp</div>
<div>50000002806200701.shx</div>
<div>50000002806200701.dbf<br>&nbsp;<br>The naming parts/chunks that are concatenated here are actually queries in the source database (Oracle).</div>
<div>&nbsp;</div>
<div>Any examples (sample scripts, procedures)&nbsp;or hints on&nbsp;how to implement this, would be very helpful.</div>
<div>&nbsp;</div>
<div>Thanks!</div>
<div>&nbsp;</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>&nbsp;</div>
<div>I don&#39;t think it is possible using ogr2ogr.exe,&nbsp;you will need&nbsp;to&nbsp;write a small programme to do so. </div>
<div>&nbsp;</div>
<div>Sorry I have not written any script yet on such a issue. But you could what you could do is. </div>
<div>&nbsp;</div>
<div>Open a recordset and from the desired name in select statement</div>
<div>&nbsp;</div>
<div>select [select distinct FIELD1 from SHEMA.TABLE] || [select distinct FIELD2 from SHEMA.TABLE] || 01 from DUAL </div>
<div>&nbsp;</div>
<div>and then pass this into the command line parameter as string</div>
<div>&nbsp;</div>
<div>to from </div>
<div>&nbsp;</div>
<div>ogr2ogr.exe -f &quot;ESRI Shapefile&quot; &lt;string from database result&gt;.shp &quot;OCI:xxxxxxx/xxxxxxx@dbname&quot; -sql &lt;select queries that you want the output from &gt;</div>
<div>&nbsp;</div>
<div>and execute this thru shell or command prompt.</div>
<div>&nbsp;</div>
<div>Hope this helps...!!!</div>
<div>&nbsp;</div>
<div>Rgds.</div>
<div>Abhay.</div></div>