<div dir="ltr">Thank you guys and sorry for the late reply!<div><br></div><div>I will test these options on my data.</div><div><br></div><div>Silvia</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Oct 20, 2016 at 10:30 AM, Antonio Falciano <span dir="ltr"><<a href="mailto:antonio.falciano@gmail.com" target="_blank">antonio.falciano@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">Il 18/10/2016 18:13, Óscar Martínez ha scritto:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Silvia,<br>
<br>
Sorry with our last emails I forgot this one.<br>
<br>
So this two quick scripts:<br>
<br>
- a 2D point layer with a column of z of which I would create a 3D point<br>
layer<br>
</blockquote>
<br></span>
[...]<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
- a 2D line layer with a column containing the elevation of each corner<br>
of the line which I would create a 3D line layer.<br></span>
(*This script will be useful for lines and for polygons*, becouse their<span class=""><br>
geometry works in the same way)<br>
</span></blockquote>
<br>
[...]<br>
<br>
<br>
Hi all,<br>
alternatively, as stated in my first post, it's possible to use only one<br>
script for all types of geometries (and eventually for other layer<br>
formats different from ESRI Shapefile) using ogr2ogr:<br>
<br>
# encoding: utf-8<br>
<br>
from gvsig import *<br>
import os<br>
<br>
from gvsig import uselib<br>
uselib.use_plugin("org.gvsig.g<wbr>dal.app.mainplugin")<br>
from org.gvsig.gdal.app.mainplugin.<wbr>common import ogr2ogr<br>
<br>
def main(*args):<br>
<br>
layer = currentLayer()<br>
zfield = "ID"<br>
if layer != None:<br>
# get the input layer path (2D)<br>
datastore = layer.getDataStore()<br>
inLayerPath = datastore.getFullName()<br>
<br>
# get the output layer path (3D)<br>
dirname = os.path.dirname(inLayerPath)<br>
filename = os.path.basename(inLayerPath).<wbr>split(".")[0]<br>
# for instance, we use the same file extension of the input layer<br>
# but it could be another OGR format (e.g. SpatiaLite)<br>
extension = os.path.basename(inLayerPath).<wbr>split(".")[1]<br>
outLayerPath = os.path.join(dirname, filename + "_3D." + extension)<br>
<br>
if extension.lower() == "shp":<br>
format = "ESRI Shapefile"<br>
#elif extension.lower() == "..."<br>
# format = "..."<br>
else:<br>
print "Not implemented yet!"<br>
<br>
ogr2ogr.main(["-f", format,<br>
outLayerPath,<br>
inLayerPath,<br>
"-zfield", zfield,<br>
"-overwrite"<br>
])<br>
<br>
loadShapeFile(outLayerPath)<br>
<br>
<br>
Cheers,<span class="im HOEnZb"><br>
Antonio<br>
<br>
-- <br>
Antonio Falciano<br>
<a href="http://www.linkedin.com/in/antoniofalciano" rel="noreferrer" target="_blank">http://www.linkedin.com/in/ant<wbr>oniofalciano</a><br></span><div class="HOEnZb"><div class="h5">
______________________________<wbr>_________________<br>
Gvsig_internacional mailing list<br>
<a href="mailto:Gvsig_internacional@listserv.gva.es" target="_blank">Gvsig_internacional@listserv.g<wbr>va.es</a><br>
<br>
To see the archives, edit your preferences or unsubscribe from this mailing list, please access this url:<br>
<br>
<a href="https://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional" rel="noreferrer" target="_blank">https://listserv.gva.es/cgi-bi<wbr>n/mailman/listinfo/gvsig_inter<wbr>nacional</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div style="font-size:small">ing. Silvia Franceschi<br>Via Latemar, 22</div><div style="font-size:small">38030 Castello di Fiemme (TN)<br><br>tel: 0039 -3384501332</div></div></div></div></div></div></div>
</div>