Candini,<br><br>You can use the -sql option with the ogr2ogr utility. You can find further details of OGR's SQL capabilities in the RFC28 [1]. It also shows an example with arithmetic operations.<br><br>Tell us how it worked.<br>
<br>[1]: <a href="http://trac.osgeo.org/gdal/wiki/rfc28_sqlfunc">http://trac.osgeo.org/gdal/wiki/rfc28_sqlfunc</a><br><br><div class="gmail_quote">On Tue, Jul 19, 2011 at 3:24 PM, canduc17 <span dir="ltr"><<a href="mailto:candini@meeo.it">candini@meeo.it</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hi everyone. I have a shape file with the following characteristics:<br>
INFO: Open of `faggete.shp'<br>
using driver `ESRI Shapefile' successful.<br>
<br>
Layer name: faggete<br>
Geometry: Polygon<br>
Feature Count: 833<br>
Extent: (341942.975384, 4732949.828158) - (365163.422399, 4773205.622984)<br>
Layer SRS WKT:<br>
(unknown)<br>
FID_fagget: Integer (9.0)<br>
SUP_HA: Real (19.15)<br>
STRINGA: String (11.0)<br>
TF: String (11.0)<br>
CV: String (11.0)<br>
AX: String (11.0)<br>
DE: String (11.0)<br>
INR: String (11.0)<br>
P: String (11.0)<br>
TIPIFORE: String (11.0)<br>
INT: String (11.0)<br>
ATTRIBUTI: String (25.0)<br>
COD_UNIV: String (50.0)<br>
area_ha: Real (19.9)<br>
FID_comuni: Integer (9.0)<br>
NOME_COM: String (50.0)<br>
NumHa: Real (19.11)<br>
VolHa: Real (19.11)<br>
Y_planted: Real (19.11)<br>
Eta: Real (19.11)<br>
Ws: Real (19.11)<br>
Biomassa_e: Real (19.11)<br>
Wr: Real (19.11)<br>
Wf: Real (19.11)<br>
<br>
<br>
I need to create a new vector file applying mathematical operations to some<br>
field.<br>
For example, let's say I have to double up every value of NumHa and sum this<br>
result to every value of VolHa.<br>
And I have to insert these new values (for NumHa and VolHa) inside the new<br>
vector.<br>
How can I achieve this?<br>
Is that possible with ogr2ogr?<br>
<br>
Thanks in advance...<br>
<font color="#888888"><br>
--<br>
View this message in context: <a href="http://osgeo-org.1803224.n2.nabble.com/ogr2ogr-create-a-new-shapefile-with-some-math-tp6598180p6598180.html" target="_blank">http://osgeo-org.1803224.n2.nabble.com/ogr2ogr-create-a-new-shapefile-with-some-math-tp6598180p6598180.html</a><br>
Sent from the GDAL - Dev mailing list archive at Nabble.com.<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>
</font></blockquote></div><br><br clear="all"><br>-- <br>Best regards,<br>Chaitanya kumar CH.<br><br>+91-9494447584<br>17.2416N 80.1426E<br>