From silvia.franceschi at gmail.com Tue Oct 4 10:17:13 2016 From: silvia.franceschi at gmail.com (Silvia Franceschi) Date: Tue, 4 Oct 2016 10:17:13 +0200 Subject: [Gvsig_english] Documentation for the scripting environment Message-ID: Dear all, I am trying to use scripting inside gvSIG, I was wondering if there is some documentation to download for it, manual, quickstarts guides or something to keep as a reference at least for the main things. Any help is appreciated! Thanks Silvia -- ing. Silvia Franceschi Via Latemar, 22 38030 Castello di Fiemme (TN) tel: 0039 -3384501332 -------------- next part -------------- An HTML attachment was scrubbed... URL: From aanguix at gvsig.com Tue Oct 4 10:37:27 2016 From: aanguix at gvsig.com (Alvaro Anguix) Date: Tue, 4 Oct 2016 10:37:27 +0200 Subject: [Gvsig_english] Documentation for the scripting environment In-Reply-To: References: Message-ID: <6c773448-5d72-b26c-ea76-0d4e12f94694@gvsig.com> Hi Silvia, We have a very good documentation in Spanish and now we're translating to English. The Spanish documentation is here: https://oscar9.github.io/gvsig_scripting/es/scripting_devel_guide/2.3/index.html I hope that the documentation in English is available soon (it depends on the collaborators; is being translated by volunteers) Best Regards, Alvaro Anguix gvSIG Association www.gvsig.com On 04/10/16 10:17, Silvia Franceschi wrote: > Dear all, > I am trying to use scripting inside gvSIG, I was wondering if there is > some documentation to download for it, manual, quickstarts guides or > something to keep as a reference at least for the main things. > > Any help is appreciated! > > Thanks > > Silvia > > > -- > ing. Silvia Franceschi > Via Latemar, 22 > 38030 Castello di Fiemme (TN) > > tel: 0039 -3384501332 > > > _______________________________________________ > Gvsig_internacional mailing list > Gvsig_internacional at listserv.gva.es > > To see the archives, edit your preferences or unsubscribe from this mailing list, please access this url: > > https://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional -------------- next part -------------- An HTML attachment was scrubbed... URL: From silvia.franceschi at gmail.com Tue Oct 4 11:09:38 2016 From: silvia.franceschi at gmail.com (Silvia Franceschi) Date: Tue, 4 Oct 2016 11:09:38 +0200 Subject: [Gvsig_english] Documentation for the scripting environment In-Reply-To: <6c773448-5d72-b26c-ea76-0d4e12f94694@gvsig.com> References: <6c773448-5d72-b26c-ea76-0d4e12f94694@gvsig.com> Message-ID: Thank you so much! Definitely a very good documentation! I will start with the Spanish version, looking forward to move to the English! Regards Silvia On Tue, Oct 4, 2016 at 10:37 AM, Alvaro Anguix wrote: > Hi Silvia, > > We have a very good documentation in Spanish and now we're translating to > English. > The Spanish documentation is here: https://oscar9.github.io/ > gvsig_scripting/es/scripting_devel_guide/2.3/index.html > I hope that the documentation in English is available soon (it depends on > the collaborators; is being translated by volunteers) > > Best Regards, > Alvaro Anguix > gvSIG Association > www.gvsig.com > > > On 04/10/16 10:17, Silvia Franceschi wrote: > > Dear all, > I am trying to use scripting inside gvSIG, I was wondering if there is > some documentation to download for it, manual, quickstarts guides or > something to keep as a reference at least for the main things. > > Any help is appreciated! > > Thanks > > Silvia > > > -- > ing. Silvia Franceschi > Via Latemar, 22 > 38030 Castello di Fiemme (TN) > > tel: 0039 -3384501332 > > > _______________________________________________ > Gvsig_internacional mailing listGvsig_internacional at listserv.gva.es > > To see the archives, edit your preferences or unsubscribe from this mailing list, please access this url: > https://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional > > > > _______________________________________________ > Gvsig_internacional mailing list > Gvsig_internacional at listserv.gva.es > > To see the archives, edit your preferences or unsubscribe from this > mailing list, please access this url: > > https://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional > > -- ing. Silvia Franceschi Via Latemar, 22 38030 Castello di Fiemme (TN) tel: 0039 -3384501332 -------------- next part -------------- An HTML attachment was scrubbed... URL: From lizbiogen at gmail.com Tue Oct 4 20:22:01 2016 From: lizbiogen at gmail.com (Lizandra Jaqueline Robe) Date: Tue, 4 Oct 2016 15:22:01 -0300 Subject: [Gvsig_english] Bioclimatic variables Message-ID: Hello guys, I just came accross GVSIG, and I was wondering if it can be used to construct bioclimatic variables from the new version 2 WorldClim data. Many thanks for any advice! Best regards, -- Lizandra Jaqueline Robe, Profa. Dra. Universidade Federal do Rio Grande - FURG Instituto de Ci?ncias Biol?gicas - ICB -------------- next part -------------- An HTML attachment was scrubbed... URL: From omartinez at gvsig.com Wed Oct 5 06:17:05 2016 From: omartinez at gvsig.com (=?UTF-8?Q?=c3=93scar_Mart=c3=adnez?=) Date: Wed, 5 Oct 2016 06:17:05 +0200 Subject: [Gvsig_english] Documentation for the scripting environment In-Reply-To: References: <6c773448-5d72-b26c-ea76-0d4e12f94694@gvsig.com> Message-ID: <45374fe3-770c-8845-3d73-583cb3e2568d@gvsig.com> Hi! The official link for the documentation will be: http://downloads.gvsig.org/download/web/html/index.html Link to the Scripting Devel Guide (ES): http://downloads.gvsig.org/download/web/html/es/scripting_devel_guide/2.3/index.html The Github link it will be just for testing and probably in the future i will delete it. I'm glad that you like the new documentation! We are currently developing these docs, please let us know if you find any bug or if any part is not well written. I hope meanwhile that google page translador works fine with these docs until we have the final translation done.. If you don't understand any party just ask me directly or in the lists. https://translate.google.es/translate?hl=es&sl=es&tl=en&u=http%3A%2F%2Fdownloads.gvsig.org%2Fdownload%2Fweb%2Fhtml%2Fes%2Fscripting_devel_guide%2F2.3%2Findex.html Best regards, ?scar On 04/10/2016 11:09, Silvia Franceschi wrote: > Thank you so much! > Definitely a very good documentation! I will start with the Spanish > version, looking forward to move to the English! > > Regards > > Silvia > > > On Tue, Oct 4, 2016 at 10:37 AM, Alvaro Anguix > wrote: > > Hi Silvia, > > We have a very good documentation in Spanish and now we're > translating to English. > The Spanish documentation is here: > https://oscar9.github.io/gvsig_scripting/es/scripting_devel_guide/2.3/index.html > > I hope that the documentation in English is available soon (it > depends on the collaborators; is being translated by volunteers) > > Best Regards, > Alvaro Anguix > gvSIG Association > www.gvsig.com > > > On 04/10/16 10:17, Silvia Franceschi wrote: >> Dear all, >> I am trying to use scripting inside gvSIG, I was wondering if >> there is some documentation to download for it, manual, >> quickstarts guides or something to keep as a reference at least >> for the main things. >> >> Any help is appreciated! >> >> Thanks >> >> Silvia >> >> >> -- >> ing. Silvia Franceschi >> Via Latemar, 22 >> 38030 Castello di Fiemme (TN) >> >> tel: 0039 -3384501332 >> >> >> _______________________________________________ >> Gvsig_internacional mailing list >> Gvsig_internacional at listserv.gva.es >> >> >> To see the archives, edit your preferences or unsubscribe from this mailing list, please access this url: >> >> https://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional >> > _______________________________________________ > Gvsig_internacional mailing list > Gvsig_internacional at listserv.gva.es > To see the archives, > edit your preferences or unsubscribe from this mailing list, > please access this url: > https://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional > > > > -- > ing. Silvia Franceschi Via Latemar, 22 > 38030 Castello di Fiemme (TN) tel: 0039 -3384501332 > > _______________________________________________ > Gvsig_internacional mailing list > Gvsig_internacional at listserv.gva.es > > To see the archives, edit your preferences or unsubscribe from this mailing list, please access this url: > > https://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional -------------- next part -------------- An HTML attachment was scrubbed... URL: From omartinez at gvsig.com Wed Oct 5 10:23:58 2016 From: omartinez at gvsig.com (=?UTF-8?Q?=c3=93scar_Mart=c3=adnez?=) Date: Wed, 5 Oct 2016 10:23:58 +0200 Subject: [Gvsig_english] Bioclimatic variables In-Reply-To: References: Message-ID: <2110aeb0-c531-e587-13fa-0f56dc8be3b7@gvsig.com> Hi! I'm not sure exactly what do you need, i found this website from WorldClim data v2 http://worldclim.org/version2 I downloaded some data and it works fine in gvSIG 2.3, they are just tiff rasters in EPSG:4326. Just load them in one view and apply some table color. We are not sure what exactly do you need to do with these data, but once is downloaded in gvSIG, is possible to execute some geoprocesses over them. Maybe other people from the list can help you more :) Best regards, Oscar On 04/10/2016 20:22, Lizandra Jaqueline Robe wrote: > Hello guys, > I just came accross GVSIG, and I was wondering if it can be used to > construct bioclimatic variables from the new version 2 WorldClim data. > Many thanks for any advice! > Best regards, > > -- > Lizandra Jaqueline Robe, Profa. Dra. > Universidade Federal do Rio Grande - FURG > Instituto de Ci?ncias Biol?gicas - ICB > > > _______________________________________________ > Gvsig_internacional mailing list > Gvsig_internacional at listserv.gva.es > > To see the archives, edit your preferences or unsubscribe from this mailing list, please access this url: > > https://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional -------------- next part -------------- An HTML attachment was scrubbed... URL: From antonio.falciano at gmail.com Wed Oct 5 10:26:35 2016 From: antonio.falciano at gmail.com (Antonio Falciano) Date: Wed, 5 Oct 2016 10:26:35 +0200 Subject: [Gvsig_english] Bioclimatic variables In-Reply-To: References: Message-ID: <9c99d562-341c-3b73-38b3-d479238a6cf8@gmail.com> Il 04/10/2016 20:22, Lizandra Jaqueline Robe ha scritto: > Hello guys, > I just came accross GVSIG, and I was wondering if it can be used to > construct bioclimatic variables from the new version 2 WorldClim data. Hi Lizandra, gvSIG can be used for such task and many others, for sure! Firstly, you can download the available WorldClim variables by tile (in reference to your area of interest) and format (e.g. GeoTIFF) from the WorldClim website. Then you can calculate other variables of your interest combining them using the Raster Calculator available in the Processing toolbox. Cheers, Antonio -- Antonio Falciano http://www.linkedin.com/in/antoniofalciano From lizbiogen at gmail.com Wed Oct 5 14:15:47 2016 From: lizbiogen at gmail.com (Lizandra Jaqueline Robe) Date: Wed, 5 Oct 2016 09:15:47 -0300 Subject: [Gvsig_english] Bioclimatic variables In-Reply-To: <9c99d562-341c-3b73-38b3-d479238a6cf8@gmail.com> References: <9c99d562-341c-3b73-38b3-d479238a6cf8@gmail.com> Message-ID: Many thanks ?scar and Antonio! I will try to execute these functions. With all the best regards, Lizandra 2016-10-05 5:26 GMT-03:00 Antonio Falciano : > Il 04/10/2016 20:22, Lizandra Jaqueline Robe ha scritto: > >> Hello guys, >> I just came accross GVSIG, and I was wondering if it can be used to >> construct bioclimatic variables from the new version 2 WorldClim data. >> > > Hi Lizandra, > gvSIG can be used for such task and many others, for sure! > Firstly, you can download the available WorldClim variables by tile (in > reference to your area of interest) and format (e.g. GeoTIFF) from the > WorldClim website. Then you can calculate other variables of your > interest combining them using the Raster Calculator available in the > Processing toolbox. > > Cheers, > Antonio > > -- > Antonio Falciano > http://www.linkedin.com/in/antoniofalciano > > _______________________________________________ > Gvsig_internacional mailing list > Gvsig_internacional at listserv.gva.es > > To see the archives, edit your preferences or unsubscribe from this > mailing list, please access this url: > > https://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional > -- Lizandra Jaqueline Robe, Profa. Dra. Universidade Federal do Rio Grande - FURG Instituto de Ci?ncias Biol?gicas - ICB -------------- next part -------------- An HTML attachment was scrubbed... URL: From silvia.franceschi at gmail.com Wed Oct 12 14:44:40 2016 From: silvia.franceschi at gmail.com (Silvia Franceschi) Date: Wed, 12 Oct 2016 14:44:40 +0200 Subject: [Gvsig_english] 3D vector layers Message-ID: Dear all, sorry for asking here, but I can not find any information about the possibility to handle 3D vector layers (as shapefiles) in gvSIG. Is it possible to create/modify a 3D vector layer (point, line) in gvSIG? I have two types of data to modify: - a 2D point layer with a column of z of which I would create a 3D point layer - a 2D line layer with a column containing the elevation of each corner of the line which I would create a 3D line layer. Any idea on how I can do? Thanks, Silvia -- ing. Silvia Franceschi Via Latemar, 22 38030 Castello di Fiemme (TN) tel: 0039 -3384501332 -------------- next part -------------- An HTML attachment was scrubbed... URL: From antonio.falciano at gmail.com Wed Oct 12 16:16:35 2016 From: antonio.falciano at gmail.com (Antonio Falciano) Date: Wed, 12 Oct 2016 16:16:35 +0200 Subject: [Gvsig_english] 3D vector layers In-Reply-To: References: Message-ID: <0233d891-8f66-7bf7-0db3-28523a9c89a9@gmail.com> Il 12/10/2016 14:44, Silvia Franceschi ha scritto: > Dear all, > sorry for asking here, but I can not find any information about the > possibility to handle 3D vector layers (as shapefiles) in gvSIG. > Is it possible to create/modify a 3D vector layer (point, line) in gvSIG? > > I have two types of data to modify: > - a 2D point layer with a column of z of which I would create a 3D point > layer > - a 2D line layer with a column containing the elevation of each corner > of the line which I would create a 3D line layer. > > Any idea on how I can do? Hi Silvia, these kind of tasks are easy to solve using OGR (available in gvSIG 2.3). For instance: ogr2ogr layer3D.shp layer2D.shp -zfield z So this may be matter of a Jython script in gvSIG. Antonio -- Antonio Falciano http://www.linkedin.com/in/antoniofalciano From silvia.franceschi at gmail.com Wed Oct 12 16:48:52 2016 From: silvia.franceschi at gmail.com (Silvia Franceschi) Date: Wed, 12 Oct 2016 16:48:52 +0200 Subject: [Gvsig_english] 3D vector layers In-Reply-To: <0233d891-8f66-7bf7-0db3-28523a9c89a9@gmail.com> References: <0233d891-8f66-7bf7-0db3-28523a9c89a9@gmail.com> Message-ID: Wow, many thanks Antonio, always very helpful! :-D Silvia On Wed, Oct 12, 2016 at 4:16 PM, Antonio Falciano < antonio.falciano at gmail.com> wrote: > Il 12/10/2016 14:44, Silvia Franceschi ha scritto: > >> Dear all, >> sorry for asking here, but I can not find any information about the >> possibility to handle 3D vector layers (as shapefiles) in gvSIG. >> Is it possible to create/modify a 3D vector layer (point, line) in gvSIG? >> >> I have two types of data to modify: >> - a 2D point layer with a column of z of which I would create a 3D point >> layer >> - a 2D line layer with a column containing the elevation of each corner >> of the line which I would create a 3D line layer. >> >> Any idea on how I can do? >> > > Hi Silvia, > these kind of tasks are easy to solve using OGR (available in gvSIG 2.3). > For instance: ogr2ogr layer3D.shp layer2D.shp -zfield z > So this may be matter of a Jython script in gvSIG. > > Antonio > > -- > Antonio Falciano > http://www.linkedin.com/in/antoniofalciano > _______________________________________________ > Gvsig_internacional mailing list > Gvsig_internacional at listserv.gva.es > > To see the archives, edit your preferences or unsubscribe from this > mailing list, please access this url: > > https://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional > -- ing. Silvia Franceschi Via Latemar, 22 38030 Castello di Fiemme (TN) tel: 0039 -3384501332 -------------- next part -------------- An HTML attachment was scrubbed... URL: From silvia.franceschi at gmail.com Thu Oct 13 15:05:52 2016 From: silvia.franceschi at gmail.com (Silvia Franceschi) Date: Thu, 13 Oct 2016 15:05:52 +0200 Subject: [Gvsig_english] How to access schema from an input shapefile in scripting Message-ID: Hi all, I am trying to write my first script in gvSIG and Python, I need to read a point shapefile and filter some elements that are outside a defined area. To do this I have to read two input layers, one with the points and one with the area and then work on each single features of the point layer. I started with the selection of the input layers using a filechooser dialog (commonsdialog.filechooser) and then I need to obtain the schema of these layers, but it seems that the object filechooser do not have the .getSchema() function. Do you have any idea on how to obtain the schema from a vector layer selected using the filechooser? Thanks in advance for any help! Silvia -- ing. Silvia Franceschi Via Latemar, 22 38030 Castello di Fiemme (TN) tel: 0039 -3384501332 -------------- next part -------------- An HTML attachment was scrubbed... URL: From omartinez at gvsig.com Thu Oct 13 18:00:21 2016 From: omartinez at gvsig.com (=?UTF-8?Q?=c3=93scar_Mart=c3=adnez?=) Date: Thu, 13 Oct 2016 18:00:21 +0200 Subject: [Gvsig_english] How to access schema from an input shapefile in scripting In-Reply-To: References: Message-ID: Hi! If i understood correctly, you don't need to use the getSchema function. I'm going to give you my solution with two test layers, give it a try and tell us if that works for you or what exactly more do you need. If you don't understand some part of the script i can explain it better. Some help is inside the script, step by step. I recommend to you to start learning scripting using the functions currentLayer() (current layer selection in the table of contents) or currentView().getLayer("layername") instead of using loadShapeFile everytime. It's easier if you just have a loaded layer in your view and access to each one each layer with currentLayer o getLayer. If someone on the list want to know more about this part of scripting, here are some links from the spanish docs (hope soon in english) related to this post: Access to features: http://downloads.gvsig.org/download/web/html/es/scripting_devel_guide/2.3/acceso_a_objetos.html#entidad Spatial operations: http://downloads.gvsig.org/download/web/html/es/scripting_devel_guide/2.3/modulo_geom.html#operaciones-espaciales Current functions: http://downloads.gvsig.org/download/web/html/es/scripting_devel_guide/2.3/acceso_a_objetos.html Any trouble here we are! Best regards, ?scar Script (layers of this test are in EPSG:25830) (feature AREA1 is a multipolygon): # encoding: utf-8 import gvsig def main(*args): # You need to have one view with to layers opened on it # The name of the layers will be the name that appear # in the table of contents of the view # To access to the layers that are already loaded in gvSIG # gvsig.currentView() give us access to the opened view # gvsig.currentView().getLayer(name) give us access a specified layer points = gvsig.currentView().getLayer("points") area = gvsig.currentView().getLayer("area") # Access to the features features_points = points.features() features_area = area.features() # if you want access to a selection of features, not all # you will have to change `features()` with `getSelection()` #features_points = points.getSelection() #features_area = area.getSelection() for farea in features_area: print "\nChecking : ", farea.get("localId") geom_farea = farea.geometry() #for each area, check all points without intersection for fpoint in features_points: geom_fpoint = fpoint.geometry() if not geom_farea.intersects(geom_fpoint): print "\tArea: ", farea.get("localId"), " intersects with :", fpoint.get("ID") # work with the feature Console output: Running script testing_silvia_intersec. Checking : AREA1 Area: AREA1 intersects with : 101 Area: AREA1 intersects with : 102 Area: AREA1 intersects with : 103 Area: AREA1 intersects with : 107 Checking : AREA2 Area: AREA2 intersects with : 103 Area: AREA2 intersects with : 104 Area: AREA2 intersects with : 105 Area: AREA2 intersects with : 106 Area: AREA2 intersects with : 107 Area: AREA2 intersects with : 108 Script testing_silvia_intersec terminated. El 13/10/16 a las 15:05, Silvia Franceschi escribi?: > Hi all, > I am trying to write my first script in gvSIG and Python, I need to > read a point shapefile and filter some elements that are outside a > defined area. > To do this I have to read two input layers, one with the points and > one with the area and then work on each single features of the point > layer. > I started with the selection of the input layers using a filechooser > dialog (commonsdialog.filechooser) and then I need to obtain the > schema of these layers, but it seems that the object filechooser do > not have the .getSchema() function. > Do you have any idea on how to obtain the schema from a vector layer > selected using the filechooser? > > Thanks in advance for any help! > > Silvia > > > -- > ing. Silvia Franceschi > Via Latemar, 22 > 38030 Castello di Fiemme (TN) > > tel: 0039 -3384501332 > > > _______________________________________________ > Gvsig_internacional mailing list > Gvsig_internacional at listserv.gva.es > > To see the archives, edit your preferences or unsubscribe from this mailing list, please access this url: > > https://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: shape_intersection_points.zip Type: application/zip Size: 3669 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: example.png Type: image/png Size: 152697 bytes Desc: not available URL: From silvia.franceschi at gmail.com Thu Oct 13 18:25:08 2016 From: silvia.franceschi at gmail.com (Silvia Franceschi) Date: Thu, 13 Oct 2016 18:25:08 +0200 Subject: [Gvsig_english] How to access schema from an input shapefile in scripting In-Reply-To: References: Message-ID: Thank you ?scar, to tell you the truth I started to use currentLayer but, since I need to work with two layers I didn't know how to do and tried to load data from files. And in any case the final script should work with a list of shapefiles in a folder, so, I will for sure move to the file based data source at some point. I was following the documentation you linked, it is very useful to start to get familiar with the scripting environment, thanks! I will try the scripts you sent to me and let you know if I will solve my problems. Thank you very much for the quick answer! Silvia On Thu, Oct 13, 2016 at 6:00 PM, ?scar Mart?nez wrote: > Hi! > > If i understood correctly, you don't need to use the getSchema function. > I'm going to give you my solution with two test layers, give it a try and > tell us if that works for you or what exactly more do you need. If you > don't understand some part of the script i can explain it better. Some help > is inside the script, step by step. > > I recommend to you to start learning scripting using the functions > currentLayer() (current layer selection in the table of contents) or > currentView().getLayer("layername") instead of using loadShapeFile > everytime. It's easier if you just have a loaded layer in your view and > access to each one each layer with currentLayer o getLayer. > > If someone on the list want to know more about this part of scripting, > here are some links from the spanish docs (hope soon in english) related to > this post: > > Access to features: http://downloads.gvsig.org/download/web/html/es/ > scripting_devel_guide/2.3/acceso_a_objetos.html#entidad > > Spatial operations: http://downloads.gvsig.org/download/web/html/es/ > scripting_devel_guide/2.3/modulo_geom.html#operaciones-espaciales > > Current functions: http://downloads.gvsig.org/download/web/html/es/ > scripting_devel_guide/2.3/acceso_a_objetos.html > > > Any trouble here we are! > > > Best regards, > > ?scar > > > > Script (layers of this test are in EPSG:25830) (feature AREA1 is a > multipolygon): > > # encoding: utf-8 > > import gvsig > > def main(*args): > # You need to have one view with to layers opened on it > # The name of the layers will be the name that appear > # in the table of contents of the view > > # To access to the layers that are already loaded in gvSIG > # gvsig.currentView() give us access to the opened view > # gvsig.currentView().getLayer(name) give us access a specified layer > points = gvsig.currentView().getLayer("points") > area = gvsig.currentView().getLayer("area") > > # Access to the features > features_points = points.features() > features_area = area.features() > > # if you want access to a selection of features, not all > # you will have to change `features()` with `getSelection()` > #features_points = points.getSelection() > #features_area = area.getSelection() > > for farea in features_area: > print "\nChecking : ", farea.get("localId") > geom_farea = farea.geometry() > > #for each area, check all points without intersection > for fpoint in features_points: > geom_fpoint = fpoint.geometry() > > if not geom_farea.intersects(geom_fpoint): > print "\tArea: ", farea.get("localId"), " intersects with > :", fpoint.get("ID") > # work with the feature > > Console output: > > Running script testing_silvia_intersec. > > Checking : AREA1 > Area: AREA1 intersects with : 101 > Area: AREA1 intersects with : 102 > Area: AREA1 intersects with : 103 > Area: AREA1 intersects with : 107 > > Checking : AREA2 > Area: AREA2 intersects with : 103 > Area: AREA2 intersects with : 104 > Area: AREA2 intersects with : 105 > Area: AREA2 intersects with : 106 > Area: AREA2 intersects with : 107 > Area: AREA2 intersects with : 108 > Script testing_silvia_intersec terminated. > > > > El 13/10/16 a las 15:05, Silvia Franceschi escribi?: > > Hi all, > I am trying to write my first script in gvSIG and Python, I need to read a > point shapefile and filter some elements that are outside a defined area. > To do this I have to read two input layers, one with the points and one > with the area and then work on each single features of the point layer. > I started with the selection of the input layers using a filechooser > dialog (commonsdialog.filechooser) and then I need to obtain the schema of > these layers, but it seems that the object filechooser do not have the > .getSchema() function. > Do you have any idea on how to obtain the schema from a vector layer > selected using the filechooser? > > Thanks in advance for any help! > > Silvia > > > -- > ing. Silvia Franceschi > Via Latemar, 22 > 38030 Castello di Fiemme (TN) > > tel: 0039 -3384501332 > > > _______________________________________________ > Gvsig_internacional mailing listGvsig_internacional at listserv.gva.es > > To see the archives, edit your preferences or unsubscribe from this mailing list, please access this url: > https://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional > > > > _______________________________________________ > Gvsig_internacional mailing list > Gvsig_internacional at listserv.gva.es > > To see the archives, edit your preferences or unsubscribe from this > mailing list, please access this url: > > https://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional > > -- ing. Silvia Franceschi Via Latemar, 22 38030 Castello di Fiemme (TN) tel: 0039 -3384501332 -------------- next part -------------- An HTML attachment was scrubbed... URL: From silvia.franceschi at gmail.com Fri Oct 14 10:53:36 2016 From: silvia.franceschi at gmail.com (Silvia Franceschi) Date: Fri, 14 Oct 2016 10:53:36 +0200 Subject: [Gvsig_english] How to access schema from an input shapefile in scripting In-Reply-To: References: Message-ID: Hi ?scar, the scripts work fine, many thanks again! May I just ask you one more question? Is there the possibility to remove a feature from a list of features? like featureslist.remove() or something like that? I tried with remove and delete but it seems that these do not exist, any idea? Is there a way to know which functions are implemented for each feature type in gvSIG scripting? Thanks Silvia On Thu, Oct 13, 2016 at 6:25 PM, Silvia Franceschi < silvia.franceschi at gmail.com> wrote: > Thank you ?scar, > to tell you the truth I started to use currentLayer but, since I need to > work with two layers I didn't know how to do and tried to load data from > files. > And in any case the final script should work with a list of shapefiles in > a folder, so, I will for sure move to the file based data source at some > point. > > I was following the documentation you linked, it is very useful to start > to get familiar with the scripting environment, thanks! > > I will try the scripts you sent to me and let you know if I will solve my > problems. > > Thank you very much for the quick answer! > > Silvia > > > > > On Thu, Oct 13, 2016 at 6:00 PM, ?scar Mart?nez > wrote: > >> Hi! >> >> If i understood correctly, you don't need to use the getSchema function. >> I'm going to give you my solution with two test layers, give it a try and >> tell us if that works for you or what exactly more do you need. If you >> don't understand some part of the script i can explain it better. Some help >> is inside the script, step by step. >> >> I recommend to you to start learning scripting using the functions >> currentLayer() (current layer selection in the table of contents) or >> currentView().getLayer("layername") instead of using loadShapeFile >> everytime. It's easier if you just have a loaded layer in your view and >> access to each one each layer with currentLayer o getLayer. >> >> If someone on the list want to know more about this part of scripting, >> here are some links from the spanish docs (hope soon in english) related to >> this post: >> >> Access to features: http://downloads.gvsig.org/dow >> nload/web/html/es/scripting_devel_guide/2.3/acceso_a_objetos.html#entidad >> >> Spatial operations: http://downloads.gvsig.org/dow >> nload/web/html/es/scripting_devel_guide/2.3/modulo_geom. >> html#operaciones-espaciales >> >> Current functions: http://downloads.gvsig.org/dow >> nload/web/html/es/scripting_devel_guide/2.3/acceso_a_objetos.html >> >> >> Any trouble here we are! >> >> >> Best regards, >> >> ?scar >> >> >> >> Script (layers of this test are in EPSG:25830) (feature AREA1 is a >> multipolygon): >> >> # encoding: utf-8 >> >> import gvsig >> >> def main(*args): >> # You need to have one view with to layers opened on it >> # The name of the layers will be the name that appear >> # in the table of contents of the view >> >> # To access to the layers that are already loaded in gvSIG >> # gvsig.currentView() give us access to the opened view >> # gvsig.currentView().getLayer(name) give us access a specified layer >> points = gvsig.currentView().getLayer("points") >> area = gvsig.currentView().getLayer("area") >> >> # Access to the features >> features_points = points.features() >> features_area = area.features() >> >> # if you want access to a selection of features, not all >> # you will have to change `features()` with `getSelection()` >> #features_points = points.getSelection() >> #features_area = area.getSelection() >> >> for farea in features_area: >> print "\nChecking : ", farea.get("localId") >> geom_farea = farea.geometry() >> >> #for each area, check all points without intersection >> for fpoint in features_points: >> geom_fpoint = fpoint.geometry() >> >> if not geom_farea.intersects(geom_fpoint): >> print "\tArea: ", farea.get("localId"), " intersects with >> :", fpoint.get("ID") >> # work with the feature >> >> Console output: >> >> Running script testing_silvia_intersec. >> >> Checking : AREA1 >> Area: AREA1 intersects with : 101 >> Area: AREA1 intersects with : 102 >> Area: AREA1 intersects with : 103 >> Area: AREA1 intersects with : 107 >> >> Checking : AREA2 >> Area: AREA2 intersects with : 103 >> Area: AREA2 intersects with : 104 >> Area: AREA2 intersects with : 105 >> Area: AREA2 intersects with : 106 >> Area: AREA2 intersects with : 107 >> Area: AREA2 intersects with : 108 >> Script testing_silvia_intersec terminated. >> >> >> >> El 13/10/16 a las 15:05, Silvia Franceschi escribi?: >> >> Hi all, >> I am trying to write my first script in gvSIG and Python, I need to read >> a point shapefile and filter some elements that are outside a defined area. >> To do this I have to read two input layers, one with the points and one >> with the area and then work on each single features of the point layer. >> I started with the selection of the input layers using a filechooser >> dialog (commonsdialog.filechooser) and then I need to obtain the schema of >> these layers, but it seems that the object filechooser do not have the >> .getSchema() function. >> Do you have any idea on how to obtain the schema from a vector layer >> selected using the filechooser? >> >> Thanks in advance for any help! >> >> Silvia >> >> >> -- >> ing. Silvia Franceschi >> Via Latemar, 22 >> 38030 Castello di Fiemme (TN) >> >> tel: 0039 -3384501332 >> >> >> _______________________________________________ >> Gvsig_internacional mailing listGvsig_internacional at listserv.gva.es >> >> To see the archives, edit your preferences or unsubscribe from this mailing list, please access this url: >> https://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional >> >> >> >> _______________________________________________ >> Gvsig_internacional mailing list >> Gvsig_internacional at listserv.gva.es >> >> To see the archives, edit your preferences or unsubscribe from this >> mailing list, please access this url: >> >> https://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional >> >> > > > -- > ing. Silvia Franceschi > Via Latemar, 22 > 38030 Castello di Fiemme (TN) > > tel: 0039 -3384501332 > -- ing. Silvia Franceschi Via Latemar, 22 38030 Castello di Fiemme (TN) tel: 0039 -3384501332 -------------- next part -------------- An HTML attachment was scrubbed... URL: From omartinez at gvsig.com Fri Oct 14 11:26:55 2016 From: omartinez at gvsig.com (=?UTF-8?Q?=c3=93scar_Mart=c3=adnez?=) Date: Fri, 14 Oct 2016 11:26:55 +0200 Subject: [Gvsig_english] How to access schema from an input shapefile in scripting In-Reply-To: References: Message-ID: Hi Silvia, | Is there a way to know which functions are implemented for each feature type in gvSIG scripting? If i understand correctly your question.. Quick answer, all. Since 2.3, we are not working with a different library for scripting. We improved the way to work directly with the JAVA API, plus new functions (like.. createShape(schema)), methods (like.. getValues() over a feature to return a python dict) and new classes (like.. FormPanel to create scripts with graphical interface), all to make it easy and quick to work from scripting. Not sure if is a good way to say it (just to explain this better), but we could say right now is the java api who hasn't have all the funcions implemented. As you can see in the script, type(layer) and type(features) are java objects. Running script. layer type: layer features: Script terminated. So, you should be able to check the javadocs, and use all the functions that are in there: http://downloads.gvsig.org/download/gvsig-desktop-testing/dists/2.3.0/javadocs/html/ http://downloads.gvsig.org/download/gvsig-desktop-testing/dists/2.3.0/javadocs/html/org/gvsig/fmap/mapcontext/layers/vectorial/FLyrVect.html http://downloads.gvsig.org/download/gvsig-desktop-testing/dists/2.3.0/javadocs/html/org/gvsig/fmap/dal/feature/impl/featureset/DefaultFeatureSet.html Plus all from scripting (we are updating this javadoc, soon will be more complete): http://downloads.gvsig.org/download/gvsig-desktop-testing/dists/2.3.0/docs/javadocs/html/ Deleting features should be something similar to this (delete all features with a filter "ID < 10"): # encoding: utf-8 from gvsig import * def main(*args): """ Delete features inside a layer""" layer = currentLayer() features = layer.features("ID < 10") #DefaultFeatureSet print "layer type: ", type(layer) print "layer features: ", type(features) layer.edit() for i in features: ivalues = i.getValues() print ivalues features.delete(i)#delete over the featureset layer.commit() Best regards, ?scar El 14/10/16 a las 10:53, Silvia Franceschi escribi?: > Hi ?scar, > the scripts work fine, many thanks again! > May I just ask you one more question? > Is there the possibility to remove a feature from a list of features? > like featureslist.remove() or something like that? > I tried with remove and delete but it seems that these do not exist, > any idea? > > Is there a way to know which functions are implemented for each > feature type in gvSIG scripting? > > Thanks > > Silvia > > > On Thu, Oct 13, 2016 at 6:25 PM, Silvia Franceschi > > wrote: > > Thank you ?scar, > to tell you the truth I started to use currentLayer but, since I > need to work with two layers I didn't know how to do and tried to > load data from files. > And in any case the final script should work with a list of > shapefiles in a folder, so, I will for sure move to the file based > data source at some point. > > I was following the documentation you linked, it is very useful to > start to get familiar with the scripting environment, thanks! > > I will try the scripts you sent to me and let you know if I will > solve my problems. > > Thank you very much for the quick answer! > > Silvia > > > > > On Thu, Oct 13, 2016 at 6:00 PM, ?scar Mart?nez > > wrote: > > Hi! > > If i understood correctly, you don't need to use the getSchema > function. I'm going to give you my solution with two test > layers, give it a try and tell us if that works for you or > what exactly more do you need. If you don't understand some > part of the script i can explain it better. Some help is > inside the script, step by step. > > I recommend to you to start learning scripting using the > functions currentLayer() (current layer selection in the table > of contents) or currentView().getLayer("layername") instead of > using loadShapeFile everytime. It's easier if you just have a > loaded layer in your view and access to each one each layer > with currentLayer o getLayer. > > If someone on the list want to know more about this part of > scripting, here are some links from the spanish docs (hope > soon in english) related to this post: > > Access to features: > http://downloads.gvsig.org/download/web/html/es/scripting_devel_guide/2.3/acceso_a_objetos.html#entidad > > > Spatial operations: > http://downloads.gvsig.org/download/web/html/es/scripting_devel_guide/2.3/modulo_geom.html#operaciones-espaciales > > > Current functions: > http://downloads.gvsig.org/download/web/html/es/scripting_devel_guide/2.3/acceso_a_objetos.html > > > > Any trouble here we are! > > > Best regards, > > ?scar > > > > Script (layers of this test are in EPSG:25830) (feature AREA1 > is a multipolygon): > > # encoding: utf-8 > > import gvsig > > def main(*args): > # You need to have one view with to layers opened on it > # The name of the layers will be the name that appear > # in the table of contents of the view > > # To access to the layers that are already loaded in gvSIG > # gvsig.currentView() give us access to the opened view > # gvsig.currentView().getLayer(name) give us access a > specified layer > points = gvsig.currentView().getLayer("points") > area = gvsig.currentView().getLayer("area") > > # Access to the features > features_points = points.features() > features_area = area.features() > > # if you want access to a selection of features, not all > # you will have to change `features()` with `getSelection()` > #features_points = points.getSelection() > #features_area = area.getSelection() > > for farea in features_area: > print "\nChecking : ", farea.get("localId") > geom_farea = farea.geometry() > > #for each area, check all points without intersection > for fpoint in features_points: > geom_fpoint = fpoint.geometry() > > if not geom_farea.intersects(geom_fpoint): > print "\tArea: ", farea.get("localId"), " > intersects with :", fpoint.get("ID") > # work with the feature > > Console output: > > Running script testing_silvia_intersec. > > Checking : AREA1 > Area: AREA1 intersects with : 101 > Area: AREA1 intersects with : 102 > Area: AREA1 intersects with : 103 > Area: AREA1 intersects with : 107 > > Checking : AREA2 > Area: AREA2 intersects with : 103 > Area: AREA2 intersects with : 104 > Area: AREA2 intersects with : 105 > Area: AREA2 intersects with : 106 > Area: AREA2 intersects with : 107 > Area: AREA2 intersects with : 108 > Script testing_silvia_intersec terminated. > > > > El 13/10/16 a las 15:05, Silvia Franceschi escribi?: >> Hi all, >> I am trying to write my first script in gvSIG and Python, I >> need to read a point shapefile and filter some elements that >> are outside a defined area. >> To do this I have to read two input layers, one with the >> points and one with the area and then work on each single >> features of the point layer. >> I started with the selection of the input layers using a >> filechooser dialog (commonsdialog.filechooser) and then I >> need to obtain the schema of these layers, but it seems that >> the object filechooser do not have the .getSchema() function. >> Do you have any idea on how to obtain the schema from a >> vector layer selected using the filechooser? >> >> Thanks in advance for any help! >> >> Silvia >> >> >> -- >> ing. Silvia Franceschi >> Via Latemar, 22 >> 38030 Castello di Fiemme (TN) >> >> tel: 0039 -3384501332 >> >> >> _______________________________________________ >> Gvsig_internacional mailing list >> Gvsig_internacional at listserv.gva.es >> >> >> To see the archives, edit your preferences or unsubscribe from this mailing list, please access this url: >> >> https://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional >> > _______________________________________________ > Gvsig_internacional mailing list > Gvsig_internacional at listserv.gva.es > To see the > archives, edit your preferences or unsubscribe from this > mailing list, please access this url: > https://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional > > > > -- > ing. Silvia Franceschi Via Latemar, 22 > 38030 Castello di Fiemme (TN) tel: 0039 -3384501332 > > > -- > ing. Silvia Franceschi Via Latemar, 22 > 38030 Castello di Fiemme (TN) tel: 0039 -3384501332 > > _______________________________________________ > Gvsig_internacional mailing list > Gvsig_internacional at listserv.gva.es > > To see the archives, edit your preferences or unsubscribe from this mailing list, please access this url: > > https://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional -------------- next part -------------- An HTML attachment was scrubbed... URL: From omartinez at gvsig.com Fri Oct 14 11:59:29 2016 From: omartinez at gvsig.com (=?UTF-8?Q?=c3=93scar_Mart=c3=adnez?=) Date: Fri, 14 Oct 2016 11:59:29 +0200 Subject: [Gvsig_english] How to access schema from an input shapefile in scripting In-Reply-To: References: Message-ID: Reading again your email maybe this also answer your question: Inside the script you can make a: print dir(layer) and it will show you the avalaible functions of that type of object. El 14/10/16 a las 11:26, ?scar Mart?nez escribi?: > > Hi Silvia, > > > | Is there a way to know which functions are implemented for each > feature type in gvSIG scripting? > > If i understand correctly your question.. Quick answer, all. Since > 2.3, we are not working with a different library for scripting. We > improved the way to work directly with the JAVA API, plus new > functions (like.. createShape(schema)), methods (like.. getValues() > over a feature to return a python dict) and new classes (like.. > FormPanel to create scripts with graphical interface), all to make it > easy and quick to work from scripting. Not sure if is a good way to > say it (just to explain this better), but we could say right now is > the java api who hasn't have all the funcions implemented. > > As you can see in the script, type(layer) and type(features) are java > objects. > > Running script. > layer type: > layer features: 'org.gvsig.fmap.dal.feature.impl.featureset.DefaultFeatureSet'> > Script terminated. > > So, you should be able to check the javadocs, and use all the > functions that are in there: > > http://downloads.gvsig.org/download/gvsig-desktop-testing/dists/2.3.0/javadocs/html/ > > http://downloads.gvsig.org/download/gvsig-desktop-testing/dists/2.3.0/javadocs/html/org/gvsig/fmap/mapcontext/layers/vectorial/FLyrVect.html > > http://downloads.gvsig.org/download/gvsig-desktop-testing/dists/2.3.0/javadocs/html/org/gvsig/fmap/dal/feature/impl/featureset/DefaultFeatureSet.html > > > Plus all from scripting (we are updating this javadoc, soon will be > more complete): > > http://downloads.gvsig.org/download/gvsig-desktop-testing/dists/2.3.0/docs/javadocs/html/ > > > Deleting features should be something similar to this (delete all > features with a filter "ID < 10"): > > # encoding: utf-8 > > from gvsig import * > > def main(*args): > """ Delete features inside a layer""" > > layer = currentLayer() > features = layer.features("ID < 10") #DefaultFeatureSet > > > print "layer type: ", type(layer) > print "layer features: ", type(features) > > layer.edit() > > for i in features: > ivalues = i.getValues() > print ivalues > features.delete(i)#delete over the featureset > > layer.commit() > > > Best regards, > ?scar > > > El 14/10/16 a las 10:53, Silvia Franceschi escribi?: >> Hi ?scar, >> the scripts work fine, many thanks again! >> May I just ask you one more question? >> Is there the possibility to remove a feature from a list of features? >> like featureslist.remove() or something like that? >> I tried with remove and delete but it seems that these do not exist, >> any idea? >> >> Is there a way to know which functions are implemented for each >> feature type in gvSIG scripting? >> >> Thanks >> >> Silvia >> >> >> On Thu, Oct 13, 2016 at 6:25 PM, Silvia Franceschi >> > wrote: >> >> Thank you ?scar, >> to tell you the truth I started to use currentLayer but, since I >> need to work with two layers I didn't know how to do and tried to >> load data from files. >> And in any case the final script should work with a list of >> shapefiles in a folder, so, I will for sure move to the file >> based data source at some point. >> >> I was following the documentation you linked, it is very useful >> to start to get familiar with the scripting environment, thanks! >> >> I will try the scripts you sent to me and let you know if I will >> solve my problems. >> >> Thank you very much for the quick answer! >> >> Silvia >> >> >> >> >> On Thu, Oct 13, 2016 at 6:00 PM, ?scar Mart?nez >> > wrote: >> >> Hi! >> >> If i understood correctly, you don't need to use the >> getSchema function. I'm going to give you my solution with >> two test layers, give it a try and tell us if that works for >> you or what exactly more do you need. If you don't understand >> some part of the script i can explain it better. Some help is >> inside the script, step by step. >> >> I recommend to you to start learning scripting using the >> functions currentLayer() (current layer selection in the >> table of contents) or currentView().getLayer("layername") >> instead of using loadShapeFile everytime. It's easier if you >> just have a loaded layer in your view and access to each one >> each layer with currentLayer o getLayer. >> >> If someone on the list want to know more about this part of >> scripting, here are some links from the spanish docs (hope >> soon in english) related to this post: >> >> Access to features: >> http://downloads.gvsig.org/download/web/html/es/scripting_devel_guide/2.3/acceso_a_objetos.html#entidad >> >> >> Spatial operations: >> http://downloads.gvsig.org/download/web/html/es/scripting_devel_guide/2.3/modulo_geom.html#operaciones-espaciales >> >> >> Current functions: >> http://downloads.gvsig.org/download/web/html/es/scripting_devel_guide/2.3/acceso_a_objetos.html >> >> >> >> Any trouble here we are! >> >> >> Best regards, >> >> ?scar >> >> >> >> Script (layers of this test are in EPSG:25830) (feature AREA1 >> is a multipolygon): >> >> # encoding: utf-8 >> >> import gvsig >> >> def main(*args): >> # You need to have one view with to layers opened on it >> # The name of the layers will be the name that appear >> # in the table of contents of the view >> >> # To access to the layers that are already loaded in gvSIG >> # gvsig.currentView() give us access to the opened view >> # gvsig.currentView().getLayer(name) give us access a >> specified layer >> points = gvsig.currentView().getLayer("points") >> area = gvsig.currentView().getLayer("area") >> >> # Access to the features >> features_points = points.features() >> features_area = area.features() >> >> # if you want access to a selection of features, not all >> # you will have to change `features()` with `getSelection()` >> #features_points = points.getSelection() >> #features_area = area.getSelection() >> >> for farea in features_area: >> print "\nChecking : ", farea.get("localId") >> geom_farea = farea.geometry() >> >> #for each area, check all points without intersection >> for fpoint in features_points: >> geom_fpoint = fpoint.geometry() >> >> if not geom_farea.intersects(geom_fpoint): >> print "\tArea: ", farea.get("localId"), " >> intersects with :", fpoint.get("ID") >> # work with the feature >> >> Console output: >> >> Running script testing_silvia_intersec. >> >> Checking : AREA1 >> Area: AREA1 intersects with : 101 >> Area: AREA1 intersects with : 102 >> Area: AREA1 intersects with : 103 >> Area: AREA1 intersects with : 107 >> >> Checking : AREA2 >> Area: AREA2 intersects with : 103 >> Area: AREA2 intersects with : 104 >> Area: AREA2 intersects with : 105 >> Area: AREA2 intersects with : 106 >> Area: AREA2 intersects with : 107 >> Area: AREA2 intersects with : 108 >> Script testing_silvia_intersec terminated. >> >> >> >> El 13/10/16 a las 15:05, Silvia Franceschi escribi?: >>> Hi all, >>> I am trying to write my first script in gvSIG and Python, I >>> need to read a point shapefile and filter some elements that >>> are outside a defined area. >>> To do this I have to read two input layers, one with the >>> points and one with the area and then work on each single >>> features of the point layer. >>> I started with the selection of the input layers using a >>> filechooser dialog (commonsdialog.filechooser) and then I >>> need to obtain the schema of these layers, but it seems that >>> the object filechooser do not have the .getSchema() function. >>> Do you have any idea on how to obtain the schema from a >>> vector layer selected using the filechooser? >>> >>> Thanks in advance for any help! >>> >>> Silvia >>> >>> >>> -- >>> ing. Silvia Franceschi >>> Via Latemar, 22 >>> 38030 Castello di Fiemme (TN) >>> >>> tel: 0039 -3384501332 >>> >>> >>> _______________________________________________ >>> Gvsig_internacional mailing list >>> Gvsig_internacional at listserv.gva.es >>> >>> >>> To see the archives, edit your preferences or unsubscribe from this mailing list, please access this url: >>> >>> https://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional >>> >> _______________________________________________ >> Gvsig_internacional mailing list >> Gvsig_internacional at listserv.gva.es >> To see the >> archives, edit your preferences or unsubscribe from this >> mailing list, please access this url: >> https://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional >> >> >> >> -- >> ing. Silvia Franceschi Via Latemar, 22 >> 38030 Castello di Fiemme (TN) tel: 0039 -3384501332 >> >> >> -- >> ing. Silvia Franceschi Via Latemar, 22 >> 38030 Castello di Fiemme (TN) tel: 0039 -3384501332 >> >> _______________________________________________ >> Gvsig_internacional mailing list >> Gvsig_internacional at listserv.gva.es >> >> To see the archives, edit your preferences or unsubscribe from this mailing list, please access this url: >> >> https://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional > > _______________________________________________ > Gvsig_internacional mailing list > Gvsig_internacional at listserv.gva.es > > To see the archives, edit your preferences or unsubscribe from this mailing list, please access this url: > > https://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional -------------- next part -------------- An HTML attachment was scrubbed... URL: From silvia.franceschi at gmail.com Fri Oct 14 13:54:15 2016 From: silvia.franceschi at gmail.com (Silvia Franceschi) Date: Fri, 14 Oct 2016 13:54:15 +0200 Subject: [Gvsig_english] How to access schema from an input shapefile in scripting In-Reply-To: References: Message-ID: Thank you ?scar for your detailed explanation and your help! Silvia On Fri, Oct 14, 2016 at 11:59 AM, ?scar Mart?nez wrote: > Reading again your email maybe this also answer your question: > > Inside the script you can make a: print dir(layer) and it will show you > the avalaible functions of that type of object. > > El 14/10/16 a las 11:26, ?scar Mart?nez escribi?: > > Hi Silvia, > > > | Is there a way to know which functions are implemented for each > feature type in gvSIG scripting? > > If i understand correctly your question.. Quick answer, all. Since 2.3, we > are not working with a different library for scripting. We improved the way > to work directly with the JAVA API, plus new functions (like.. > createShape(schema)), methods (like.. getValues() over a feature to return > a python dict) and new classes (like.. FormPanel to create scripts with > graphical interface), all to make it easy and quick to work from scripting. > Not sure if is a good way to say it (just to explain this better), but we > could say right now is the java api who hasn't have all the funcions > implemented. > > As you can see in the script, type(layer) and type(features) are java > objects. > > Running script. > layer type: > layer features: DefaultFeatureSet'> > Script terminated. > > So, you should be able to check the javadocs, and use all the functions > that are in there: > > http://downloads.gvsig.org/download/gvsig-desktop- > testing/dists/2.3.0/javadocs/html/ > > http://downloads.gvsig.org/download/gvsig-desktop- > testing/dists/2.3.0/javadocs/html/org/gvsig/fmap/ > mapcontext/layers/vectorial/FLyrVect.html > > http://downloads.gvsig.org/download/gvsig-desktop- > testing/dists/2.3.0/javadocs/html/org/gvsig/fmap/dal/ > feature/impl/featureset/DefaultFeatureSet.html > > > Plus all from scripting (we are updating this javadoc, soon will be more > complete): > > http://downloads.gvsig.org/download/gvsig-desktop- > testing/dists/2.3.0/docs/javadocs/html/ > > > Deleting features should be something similar to this (delete all features > with a filter "ID < 10"): > # encoding: utf-8 > > from gvsig import * > > def main(*args): > """ Delete features inside a layer""" > > layer = currentLayer() > features = layer.features("ID < 10") #DefaultFeatureSet > > > print "layer type: ", type(layer) > print "layer features: ", type(features) > > layer.edit() > > for i in features: > ivalues = i.getValues() > print ivalues > features.delete(i)#delete over the featureset > > layer.commit() > > > Best regards, > ?scar > > > El 14/10/16 a las 10:53, Silvia Franceschi escribi?: > > Hi ?scar, > the scripts work fine, many thanks again! > May I just ask you one more question? > Is there the possibility to remove a feature from a list of features? like > featureslist.remove() or something like that? > I tried with remove and delete but it seems that these do not exist, any > idea? > > Is there a way to know which functions are implemented for each feature > type in gvSIG scripting? > > Thanks > > Silvia > > > On Thu, Oct 13, 2016 at 6:25 PM, Silvia Franceschi < > silvia.franceschi at gmail.com> wrote: > >> Thank you ?scar, >> to tell you the truth I started to use currentLayer but, since I need to >> work with two layers I didn't know how to do and tried to load data from >> files. >> And in any case the final script should work with a list of shapefiles in >> a folder, so, I will for sure move to the file based data source at some >> point. >> >> I was following the documentation you linked, it is very useful to start >> to get familiar with the scripting environment, thanks! >> >> I will try the scripts you sent to me and let you know if I will solve my >> problems. >> >> Thank you very much for the quick answer! >> >> Silvia >> >> >> >> >> On Thu, Oct 13, 2016 at 6:00 PM, ?scar Mart?nez >> wrote: >> >>> Hi! >>> >>> If i understood correctly, you don't need to use the getSchema function. >>> I'm going to give you my solution with two test layers, give it a try and >>> tell us if that works for you or what exactly more do you need. If you >>> don't understand some part of the script i can explain it better. Some help >>> is inside the script, step by step. >>> >>> I recommend to you to start learning scripting using the functions >>> currentLayer() (current layer selection in the table of contents) or >>> currentView().getLayer("layername") instead of using loadShapeFile >>> everytime. It's easier if you just have a loaded layer in your view and >>> access to each one each layer with currentLayer o getLayer. >>> >>> If someone on the list want to know more about this part of scripting, >>> here are some links from the spanish docs (hope soon in english) related to >>> this post: >>> >>> Access to features: http://downloads.gvsig.org/dow >>> nload/web/html/es/scripting_devel_guide/2.3/acceso_a_objetos >>> .html#entidad >>> >>> Spatial operations: http://downloads.gvsig.org/dow >>> nload/web/html/es/scripting_devel_guide/2.3/modulo_geom.html >>> #operaciones-espaciales >>> >>> Current functions: http://downloads.gvsig.org/dow >>> nload/web/html/es/scripting_devel_guide/2.3/acceso_a_objetos.html >>> >>> >>> Any trouble here we are! >>> >>> >>> Best regards, >>> >>> ?scar >>> >>> >>> >>> Script (layers of this test are in EPSG:25830) (feature AREA1 is a >>> multipolygon): >>> >>> # encoding: utf-8 >>> >>> import gvsig >>> >>> def main(*args): >>> # You need to have one view with to layers opened on it >>> # The name of the layers will be the name that appear >>> # in the table of contents of the view >>> >>> # To access to the layers that are already loaded in gvSIG >>> # gvsig.currentView() give us access to the opened view >>> # gvsig.currentView().getLayer(name) give us access a specified >>> layer >>> points = gvsig.currentView().getLayer("points") >>> area = gvsig.currentView().getLayer("area") >>> >>> # Access to the features >>> features_points = points.features() >>> features_area = area.features() >>> >>> # if you want access to a selection of features, not all >>> # you will have to change `features()` with `getSelection()` >>> #features_points = points.getSelection() >>> #features_area = area.getSelection() >>> >>> for farea in features_area: >>> print "\nChecking : ", farea.get("localId") >>> geom_farea = farea.geometry() >>> >>> #for each area, check all points without intersection >>> for fpoint in features_points: >>> geom_fpoint = fpoint.geometry() >>> >>> if not geom_farea.intersects(geom_fpoint): >>> print "\tArea: ", farea.get("localId"), " intersects >>> with :", fpoint.get("ID") >>> # work with the feature >>> >>> Console output: >>> >>> Running script testing_silvia_intersec. >>> >>> Checking : AREA1 >>> Area: AREA1 intersects with : 101 >>> Area: AREA1 intersects with : 102 >>> Area: AREA1 intersects with : 103 >>> Area: AREA1 intersects with : 107 >>> >>> Checking : AREA2 >>> Area: AREA2 intersects with : 103 >>> Area: AREA2 intersects with : 104 >>> Area: AREA2 intersects with : 105 >>> Area: AREA2 intersects with : 106 >>> Area: AREA2 intersects with : 107 >>> Area: AREA2 intersects with : 108 >>> Script testing_silvia_intersec terminated. >>> >>> >>> >>> El 13/10/16 a las 15:05, Silvia Franceschi escribi?: >>> >>> Hi all, >>> I am trying to write my first script in gvSIG and Python, I need to read >>> a point shapefile and filter some elements that are outside a defined area. >>> To do this I have to read two input layers, one with the points and one >>> with the area and then work on each single features of the point layer. >>> I started with the selection of the input layers using a filechooser >>> dialog (commonsdialog.filechooser) and then I need to obtain the schema of >>> these layers, but it seems that the object filechooser do not have the >>> .getSchema() function. >>> Do you have any idea on how to obtain the schema from a vector layer >>> selected using the filechooser? >>> >>> Thanks in advance for any help! >>> >>> Silvia >>> >>> >>> -- >>> ing. Silvia Franceschi >>> Via Latemar, 22 >>> 38030 Castello di Fiemme (TN) >>> >>> tel: 0039 -3384501332 <0039%20-3384501332> >>> >>> >>> _______________________________________________ >>> Gvsig_internacional mailing listGvsig_internacional at listserv.gva.es >>> >>> To see the archives, edit your preferences or unsubscribe from this mailing list, please access this url: >>> https://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional >>> >>> _______________________________________________ Gvsig_internacional >>> mailing list Gvsig_internacional at listserv.gva.es To see the archives, >>> edit your preferences or unsubscribe from this mailing list, please access >>> this url: https://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_inter >>> nacional >> >> -- >> ing. Silvia Franceschi Via Latemar, 22 >> 38030 Castello di Fiemme (TN) tel: 0039 -3384501332 >> > -- > ing. Silvia Franceschi Via Latemar, 22 > 38030 Castello di Fiemme (TN) tel: 0039 -3384501332 > > _______________________________________________ > Gvsig_internacional mailing listGvsig_internacional at listserv.gva.es > > To see the archives, edit your preferences or unsubscribe from this mailing list, please access this url: > https://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional > > _______________________________________________ > Gvsig_internacional mailing listGvsig_internacional at listserv.gva.es > > To see the archives, edit your preferences or unsubscribe from this mailing list, please access this url: > https://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional > > > _______________________________________________ > Gvsig_internacional mailing list > Gvsig_internacional at listserv.gva.es > > To see the archives, edit your preferences or unsubscribe from this > mailing list, please access this url: > > https://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional > > -- ing. Silvia Franceschi Via Latemar, 22 38030 Castello di Fiemme (TN) tel: 0039 -3384501332 -------------- next part -------------- An HTML attachment was scrubbed... URL: From silvia.franceschi at gmail.com Fri Oct 14 15:33:06 2016 From: silvia.franceschi at gmail.com (Silvia Franceschi) Date: Fri, 14 Oct 2016 15:33:06 +0200 Subject: [Gvsig_english] How to access schema from an input shapefile in scripting In-Reply-To: References: Message-ID: Hi ?scar, always me.. :-) is there also a way to write a layer in a shapefile directly from a script or do I have to load it in gvSIG and save it from there? Thanks Silvia On Fri, Oct 14, 2016 at 1:54 PM, Silvia Franceschi < silvia.franceschi at gmail.com> wrote: > Thank you ?scar for your detailed explanation and your help! > > Silvia > > On Fri, Oct 14, 2016 at 11:59 AM, ?scar Mart?nez > wrote: > >> Reading again your email maybe this also answer your question: >> >> Inside the script you can make a: print dir(layer) and it will show you >> the avalaible functions of that type of object. >> >> El 14/10/16 a las 11:26, ?scar Mart?nez escribi?: >> >> Hi Silvia, >> >> >> | Is there a way to know which functions are implemented for each >> feature type in gvSIG scripting? >> >> If i understand correctly your question.. Quick answer, all. Since 2.3, >> we are not working with a different library for scripting. We improved the >> way to work directly with the JAVA API, plus new functions (like.. >> createShape(schema)), methods (like.. getValues() over a feature to return >> a python dict) and new classes (like.. FormPanel to create scripts with >> graphical interface), all to make it easy and quick to work from scripting. >> Not sure if is a good way to say it (just to explain this better), but we >> could say right now is the java api who hasn't have all the funcions >> implemented. >> >> As you can see in the script, type(layer) and type(features) are java >> objects. >> >> Running script. >> layer type: >> layer features: > pl.featureset.DefaultFeatureSet'> >> Script terminated. >> >> So, you should be able to check the javadocs, and use all the functions >> that are in there: >> >> http://downloads.gvsig.org/download/gvsig-desktop-testing/ >> dists/2.3.0/javadocs/html/ >> >> http://downloads.gvsig.org/download/gvsig-desktop-testing/ >> dists/2.3.0/javadocs/html/org/gvsig/fmap/mapcontext/layers/ >> vectorial/FLyrVect.html >> >> http://downloads.gvsig.org/download/gvsig-desktop-testing/ >> dists/2.3.0/javadocs/html/org/gvsig/fmap/dal/feature/impl/ >> featureset/DefaultFeatureSet.html >> >> >> Plus all from scripting (we are updating this javadoc, soon will be more >> complete): >> >> http://downloads.gvsig.org/download/gvsig-desktop-testing/ >> dists/2.3.0/docs/javadocs/html/ >> >> >> Deleting features should be something similar to this (delete all >> features with a filter "ID < 10"): >> # encoding: utf-8 >> >> from gvsig import * >> >> def main(*args): >> """ Delete features inside a layer""" >> >> layer = currentLayer() >> features = layer.features("ID < 10") #DefaultFeatureSet >> >> >> print "layer type: ", type(layer) >> print "layer features: ", type(features) >> >> layer.edit() >> >> for i in features: >> ivalues = i.getValues() >> print ivalues >> features.delete(i)#delete over the featureset >> >> layer.commit() >> >> >> Best regards, >> ?scar >> >> >> El 14/10/16 a las 10:53, Silvia Franceschi escribi?: >> >> Hi ?scar, >> the scripts work fine, many thanks again! >> May I just ask you one more question? >> Is there the possibility to remove a feature from a list of features? >> like featureslist.remove() or something like that? >> I tried with remove and delete but it seems that these do not exist, any >> idea? >> >> Is there a way to know which functions are implemented for each feature >> type in gvSIG scripting? >> >> Thanks >> >> Silvia >> >> >> On Thu, Oct 13, 2016 at 6:25 PM, Silvia Franceschi < >> silvia.franceschi at gmail.com> wrote: >> >>> Thank you ?scar, >>> to tell you the truth I started to use currentLayer but, since I need to >>> work with two layers I didn't know how to do and tried to load data from >>> files. >>> And in any case the final script should work with a list of shapefiles >>> in a folder, so, I will for sure move to the file based data source at some >>> point. >>> >>> I was following the documentation you linked, it is very useful to start >>> to get familiar with the scripting environment, thanks! >>> >>> I will try the scripts you sent to me and let you know if I will solve >>> my problems. >>> >>> Thank you very much for the quick answer! >>> >>> Silvia >>> >>> >>> >>> >>> On Thu, Oct 13, 2016 at 6:00 PM, ?scar Mart?nez >>> wrote: >>> >>>> Hi! >>>> >>>> If i understood correctly, you don't need to use the getSchema >>>> function. I'm going to give you my solution with two test layers, give it a >>>> try and tell us if that works for you or what exactly more do you need. If >>>> you don't understand some part of the script i can explain it better. Some >>>> help is inside the script, step by step. >>>> >>>> I recommend to you to start learning scripting using the functions >>>> currentLayer() (current layer selection in the table of contents) or >>>> currentView().getLayer("layername") instead of using loadShapeFile >>>> everytime. It's easier if you just have a loaded layer in your view and >>>> access to each one each layer with currentLayer o getLayer. >>>> >>>> If someone on the list want to know more about this part of scripting, >>>> here are some links from the spanish docs (hope soon in english) related to >>>> this post: >>>> >>>> Access to features: http://downloads.gvsig.org/dow >>>> nload/web/html/es/scripting_devel_guide/2.3/acceso_a_objetos >>>> .html#entidad >>>> >>>> Spatial operations: http://downloads.gvsig.org/dow >>>> nload/web/html/es/scripting_devel_guide/2.3/modulo_geom.html >>>> #operaciones-espaciales >>>> >>>> Current functions: http://downloads.gvsig.org/dow >>>> nload/web/html/es/scripting_devel_guide/2.3/acceso_a_objetos.html >>>> >>>> >>>> Any trouble here we are! >>>> >>>> >>>> Best regards, >>>> >>>> ?scar >>>> >>>> >>>> >>>> Script (layers of this test are in EPSG:25830) (feature AREA1 is a >>>> multipolygon): >>>> >>>> # encoding: utf-8 >>>> >>>> import gvsig >>>> >>>> def main(*args): >>>> # You need to have one view with to layers opened on it >>>> # The name of the layers will be the name that appear >>>> # in the table of contents of the view >>>> >>>> # To access to the layers that are already loaded in gvSIG >>>> # gvsig.currentView() give us access to the opened view >>>> # gvsig.currentView().getLayer(name) give us access a specified >>>> layer >>>> points = gvsig.currentView().getLayer("points") >>>> area = gvsig.currentView().getLayer("area") >>>> >>>> # Access to the features >>>> features_points = points.features() >>>> features_area = area.features() >>>> >>>> # if you want access to a selection of features, not all >>>> # you will have to change `features()` with `getSelection()` >>>> #features_points = points.getSelection() >>>> #features_area = area.getSelection() >>>> >>>> for farea in features_area: >>>> print "\nChecking : ", farea.get("localId") >>>> geom_farea = farea.geometry() >>>> >>>> #for each area, check all points without intersection >>>> for fpoint in features_points: >>>> geom_fpoint = fpoint.geometry() >>>> >>>> if not geom_farea.intersects(geom_fpoint): >>>> print "\tArea: ", farea.get("localId"), " intersects >>>> with :", fpoint.get("ID") >>>> # work with the feature >>>> >>>> Console output: >>>> >>>> Running script testing_silvia_intersec. >>>> >>>> Checking : AREA1 >>>> Area: AREA1 intersects with : 101 >>>> Area: AREA1 intersects with : 102 >>>> Area: AREA1 intersects with : 103 >>>> Area: AREA1 intersects with : 107 >>>> >>>> Checking : AREA2 >>>> Area: AREA2 intersects with : 103 >>>> Area: AREA2 intersects with : 104 >>>> Area: AREA2 intersects with : 105 >>>> Area: AREA2 intersects with : 106 >>>> Area: AREA2 intersects with : 107 >>>> Area: AREA2 intersects with : 108 >>>> Script testing_silvia_intersec terminated. >>>> >>>> >>>> >>>> El 13/10/16 a las 15:05, Silvia Franceschi escribi?: >>>> >>>> Hi all, >>>> I am trying to write my first script in gvSIG and Python, I need to >>>> read a point shapefile and filter some elements that are outside a defined >>>> area. >>>> To do this I have to read two input layers, one with the points and one >>>> with the area and then work on each single features of the point layer. >>>> I started with the selection of the input layers using a filechooser >>>> dialog (commonsdialog.filechooser) and then I need to obtain the schema of >>>> these layers, but it seems that the object filechooser do not have the >>>> .getSchema() function. >>>> Do you have any idea on how to obtain the schema from a vector layer >>>> selected using the filechooser? >>>> >>>> Thanks in advance for any help! >>>> >>>> Silvia >>>> >>>> >>>> -- >>>> ing. Silvia Franceschi >>>> Via Latemar, 22 >>>> 38030 Castello di Fiemme (TN) >>>> >>>> tel: 0039 -3384501332 <0039%20-3384501332> >>>> >>>> >>>> _______________________________________________ >>>> Gvsig_internacional mailing listGvsig_internacional at listserv.gva.es >>>> >>>> To see the archives, edit your preferences or unsubscribe from this mailing list, please access this url: >>>> https://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional >>>> >>>> _______________________________________________ Gvsig_internacional >>>> mailing list Gvsig_internacional at listserv.gva.es To see the archives, >>>> edit your preferences or unsubscribe from this mailing list, please access >>>> this url: https://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_inter >>>> nacional >>> >>> -- >>> ing. Silvia Franceschi Via Latemar, 22 >>> 38030 Castello di Fiemme (TN) tel: 0039 -3384501332 >>> >> -- >> ing. Silvia Franceschi Via Latemar, 22 >> 38030 Castello di Fiemme (TN) tel: 0039 -3384501332 >> >> _______________________________________________ >> Gvsig_internacional mailing listGvsig_internacional at listserv.gva.es >> >> To see the archives, edit your preferences or unsubscribe from this mailing list, please access this url: >> https://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional >> >> _______________________________________________ >> Gvsig_internacional mailing listGvsig_internacional at listserv.gva.es >> >> To see the archives, edit your preferences or unsubscribe from this mailing list, please access this url: >> https://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional >> >> >> _______________________________________________ >> Gvsig_internacional mailing list >> Gvsig_internacional at listserv.gva.es >> >> To see the archives, edit your preferences or unsubscribe from this >> mailing list, please access this url: >> >> https://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional >> >> > > > -- > ing. Silvia Franceschi > Via Latemar, 22 > 38030 Castello di Fiemme (TN) > > tel: 0039 -3384501332 > -- ing. Silvia Franceschi Via Latemar, 22 38030 Castello di Fiemme (TN) tel: 0039 -3384501332 -------------- next part -------------- An HTML attachment was scrubbed... URL: From omartinez at gvsig.com Fri Oct 14 16:29:22 2016 From: omartinez at gvsig.com (=?UTF-8?Q?=c3=93scar_Mart=c3=adnez?=) Date: Fri, 14 Oct 2016 16:29:22 +0200 Subject: [Gvsig_english] How to access schema from an input shapefile in scripting In-Reply-To: References: Message-ID: <0c5d4af0-3c2e-3dd2-3b5a-ca481d5f4f92@gvsig.com> No problem at all! :) Sorry, i'm not sure what do you want to do.. create a new shapefile and work with it? or export (make a copy) of a existing shapefile? El 14/10/16 a las 15:33, Silvia Franceschi escribi?: > Hi ?scar, > always me.. :-) > is there also a way to write a layer in a shapefile directly from a > script or do I have to load it in gvSIG and save it from there? > > Thanks > > Silvia > > > On Fri, Oct 14, 2016 at 1:54 PM, Silvia Franceschi > > wrote: > > Thank you ?scar for your detailed explanation and your help! > > Silvia > > On Fri, Oct 14, 2016 at 11:59 AM, ?scar Mart?nez > > wrote: > > Reading again your email maybe this also answer your question: > > Inside the script you can make a: print dir(layer) and it will > show you the avalaible functions of that type of object. > > > El 14/10/16 a las 11:26, ?scar Mart?nez escribi?: >> >> Hi Silvia, >> >> >> | Is there a way to know which functions are implemented >> for each feature type in gvSIG scripting? >> >> If i understand correctly your question.. Quick answer, all. >> Since 2.3, we are not working with a different library for >> scripting. We improved the way to work directly with the JAVA >> API, plus new functions (like.. createShape(schema)), methods >> (like.. getValues() over a feature to return a python dict) >> and new classes (like.. FormPanel to create scripts with >> graphical interface), all to make it easy and quick to work >> from scripting. Not sure if is a good way to say it (just to >> explain this better), but we could say right now is the java >> api who hasn't have all the funcions implemented. >> >> As you can see in the script, type(layer) and type(features) >> are java objects. >> >> Running script. >> layer type: > 'org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect'> >> layer features: > pl.featureset.DefaultFeatureSet'> >> Script terminated. >> >> So, you should be able to check the javadocs, and use all the >> functions that are in there: >> >> http://downloads.gvsig.org/download/gvsig-desktop-testing/dists/2.3.0/javadocs/html/ >> >> >> http://downloads.gvsig.org/download/gvsig-desktop-testing/dists/2.3.0/javadocs/html/org/gvsig/fmap/mapcontext/layers/vectorial/FLyrVect.html >> >> >> http://downloads.gvsig.org/download/gvsig-desktop-testing/dists/2.3.0/javadocs/html/org/gvsig/fmap/dal/feature/impl/featureset/DefaultFeatureSet.html >> >> >> >> Plus all from scripting (we are updating this javadoc, soon >> will be more complete): >> >> http://downloads.gvsig.org/download/gvsig-desktop-testing/dists/2.3.0/docs/javadocs/html/ >> >> >> >> Deleting features should be something similar to this (delete >> all features with a filter "ID < 10"): >> >> # encoding: utf-8 >> >> from gvsig import * >> >> def main(*args): >> """ Delete features inside a layer""" >> >> layer = currentLayer() >> features = layer.features("ID < 10") #DefaultFeatureSet >> >> >> print "layer type: ", type(layer) >> print "layer features: ", type(features) >> >> layer.edit() >> >> for i in features: >> ivalues = i.getValues() >> print ivalues >> features.delete(i)#delete over the featureset >> >> layer.commit() >> >> >> Best regards, >> ?scar >> >> >> El 14/10/16 a las 10:53, Silvia Franceschi escribi?: >>> Hi ?scar, >>> the scripts work fine, many thanks again! >>> May I just ask you one more question? >>> Is there the possibility to remove a feature from a list of >>> features? like featureslist.remove() or something like that? >>> I tried with remove and delete but it seems that these do >>> not exist, any idea? >>> >>> Is there a way to know which functions are implemented for >>> each feature type in gvSIG scripting? >>> >>> Thanks >>> >>> Silvia >>> >>> >>> On Thu, Oct 13, 2016 at 6:25 PM, Silvia Franceschi >>> >> > wrote: >>> >>> Thank you ?scar, >>> to tell you the truth I started to use currentLayer but, >>> since I need to work with two layers I didn't know how >>> to do and tried to load data from files. >>> And in any case the final script should work with a list >>> of shapefiles in a folder, so, I will for sure move to >>> the file based data source at some point. >>> >>> I was following the documentation you linked, it is very >>> useful to start to get familiar with the scripting >>> environment, thanks! >>> >>> I will try the scripts you sent to me and let you know >>> if I will solve my problems. >>> >>> Thank you very much for the quick answer! >>> >>> Silvia >>> >>> >>> >>> >>> On Thu, Oct 13, 2016 at 6:00 PM, ?scar Mart?nez >>> > wrote: >>> >>> Hi! >>> >>> If i understood correctly, you don't need to use the >>> getSchema function. I'm going to give you my >>> solution with two test layers, give it a try and >>> tell us if that works for you or what exactly more >>> do you need. If you don't understand some part of >>> the script i can explain it better. Some help is >>> inside the script, step by step. >>> >>> I recommend to you to start learning scripting using >>> the functions currentLayer() (current layer >>> selection in the table of contents) or >>> currentView().getLayer("layername") instead of using >>> loadShapeFile everytime. It's easier if you just >>> have a loaded layer in your view and access to each >>> one each layer with currentLayer o getLayer. >>> >>> If someone on the list want to know more about this >>> part of scripting, here are some links from the >>> spanish docs (hope soon in english) related to this >>> post: >>> >>> Access to features: >>> http://downloads.gvsig.org/download/web/html/es/scripting_devel_guide/2.3/acceso_a_objetos.html#entidad >>> >>> >>> Spatial operations: >>> http://downloads.gvsig.org/download/web/html/es/scripting_devel_guide/2.3/modulo_geom.html#operaciones-espaciales >>> >>> >>> Current functions: >>> http://downloads.gvsig.org/download/web/html/es/scripting_devel_guide/2.3/acceso_a_objetos.html >>> >>> >>> >>> Any trouble here we are! >>> >>> >>> Best regards, >>> >>> ?scar >>> >>> >>> >>> Script (layers of this test are in EPSG:25830) >>> (feature AREA1 is a multipolygon): >>> >>> # encoding: utf-8 >>> >>> import gvsig >>> >>> def main(*args): >>> # You need to have one view with to layers >>> opened on it >>> # The name of the layers will be the name that >>> appear >>> # in the table of contents of the view >>> >>> # To access to the layers that are already >>> loaded in gvSIG >>> # gvsig.currentView() give us access to the >>> opened view >>> # gvsig.currentView().getLayer(name) give us >>> access a specified layer >>> points = gvsig.currentView().getLayer("points") >>> area = gvsig.currentView().getLayer("area") >>> >>> # Access to the features >>> features_points = points.features() >>> features_area = area.features() >>> >>> # if you want access to a selection of features, >>> not all >>> # you will have to change `features()` with >>> `getSelection()` >>> #features_points = points.getSelection() >>> #features_area = area.getSelection() >>> >>> for farea in features_area: >>> print "\nChecking : ", farea.get("localId") >>> geom_farea = farea.geometry() >>> >>> #for each area, check all points without >>> intersection >>> for fpoint in features_points: >>> geom_fpoint = fpoint.geometry() >>> >>> if not geom_farea.intersects(geom_fpoint): >>> print "\tArea: ", >>> farea.get("localId"), " intersects with :", >>> fpoint.get("ID") >>> # work with the feature >>> >>> Console output: >>> >>> Running script testing_silvia_intersec. >>> >>> Checking : AREA1 >>> Area: AREA1 intersects with : 101 >>> Area: AREA1 intersects with : 102 >>> Area: AREA1 intersects with : 103 >>> Area: AREA1 intersects with : 107 >>> >>> Checking : AREA2 >>> Area: AREA2 intersects with : 103 >>> Area: AREA2 intersects with : 104 >>> Area: AREA2 intersects with : 105 >>> Area: AREA2 intersects with : 106 >>> Area: AREA2 intersects with : 107 >>> Area: AREA2 intersects with : 108 >>> Script testing_silvia_intersec terminated. >>> >>> >>> >>> El 13/10/16 a las 15:05, Silvia Franceschi escribi?: >>>> Hi all, >>>> I am trying to write my first script in gvSIG and >>>> Python, I need to read a point shapefile and filter >>>> some elements that are outside a defined area. >>>> To do this I have to read two input layers, one >>>> with the points and one with the area and then work >>>> on each single features of the point layer. >>>> I started with the selection of the input layers >>>> using a filechooser dialog >>>> (commonsdialog.filechooser) and then I need to >>>> obtain the schema of these layers, but it seems >>>> that the object filechooser do not have the >>>> .getSchema() function. >>>> Do you have any idea on how to obtain the schema >>>> from a vector layer selected using the filechooser? >>>> >>>> Thanks in advance for any help! >>>> >>>> Silvia >>>> >>>> >>>> -- >>>> ing. Silvia Franceschi >>>> Via Latemar, 22 >>>> 38030 Castello di Fiemme (TN) >>>> >>>> tel: 0039 -3384501332 >>>> >>>> >>>> _______________________________________________ >>>> Gvsig_internacional mailing list >>>> Gvsig_internacional at listserv.gva.es >>>> >>>> >>>> To see the archives, edit your preferences or unsubscribe from this mailing list, please access this url: >>>> >>>> https://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional >>>> >>> _______________________________________________ >>> Gvsig_internacional mailing list >>> Gvsig_internacional at listserv.gva.es >>> To see >>> the archives, edit your preferences or unsubscribe >>> from this mailing list, please access this url: >>> https://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional >>> >>> >>> >>> -- >>> ing. Silvia Franceschi Via Latemar, 22 >>> 38030 Castello di Fiemme (TN) tel: 0039 -3384501332 >>> >>> >>> -- >>> ing. Silvia Franceschi Via Latemar, 22 >>> 38030 Castello di Fiemme (TN) tel: 0039 -3384501332 >>> >>> >>> _______________________________________________ >>> Gvsig_internacional mailing list >>> Gvsig_internacional at listserv.gva.es >>> >>> >>> To see the archives, edit your preferences or unsubscribe from this mailing list, please access this url: >>> >>> https://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional >>> >> >> _______________________________________________ >> Gvsig_internacional mailing list >> Gvsig_internacional at listserv.gva.es >> >> >> To see the archives, edit your preferences or unsubscribe from this mailing list, please access this url: >> >> https://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional >> > _______________________________________________ > Gvsig_internacional mailing list > Gvsig_internacional at listserv.gva.es > To see the > archives, edit your preferences or unsubscribe from this > mailing list, please access this url: > https://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional > > > > -- > ing. Silvia Franceschi Via Latemar, 22 > 38030 Castello di Fiemme (TN) tel: 0039 -3384501332 > > > -- > ing. Silvia Franceschi Via Latemar, 22 > 38030 Castello di Fiemme (TN) tel: 0039 -3384501332 > > _______________________________________________ > Gvsig_internacional mailing list > Gvsig_internacional at listserv.gva.es > > To see the archives, edit your preferences or unsubscribe from this mailing list, please access this url: > > https://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional -------------- next part -------------- An HTML attachment was scrubbed... URL: From sergio.acostaylara at mtop.gub.uy Fri Oct 14 16:59:19 2016 From: sergio.acostaylara at mtop.gub.uy (SERGIO ACOSTAYLARA) Date: Fri, 14 Oct 2016 14:59:19 +0000 Subject: [Gvsig_english] Newsletter October issue In-Reply-To: <1476457069759.63520@mtop.gub.uy> References: <20161011232059.Horde.8qVSASAEBt2kpsWe4mfwvR5@webmail.auth.gr>, <1476457069759.63520@mtop.gub.uy> Message-ID: <1476457159371.77031@mtop.gub.uy> Dear all, The October issue has been uploaded onto GeoForAll website. I would like to thank all those who helped with their contributions to have another issue for the memebers. For those who would like to sent articles, news, etc., to be published in the next issue (November issue) please have in mind that the deadline is October, 26. Have a nice reading Nikos Lambrinos -- ??. ????? ????????? ??????????? ????????? ????? ????????? ??????????? ?.?.?. 54124 ??????????? ???.: 2310 991201 / 991230 Email: labrinos at eled.auth.gr Web Page: http://users.auth.gr/labrinos/ http://www.digital-earth.edu.gr/ https://www.auth.gr/univUnits --------------------------------------------------------------------- Dr. Nikos Lambrinos Associate Professor Faculty of Education School of Primary Education Dept. of Science and New Technologies Aristotle University of Thessaloniki GR-54124 Thessaloniki, Greece Tel: +30 2310 991201 Email: labrinos at eled.auth.gr Web Page: http://users.auth.gr/labrinos/ http://www.digital-earth.edu.gr/ https://www.auth.gr/en/univUnits From silvia.franceschi at gmail.com Fri Oct 14 19:21:12 2016 From: silvia.franceschi at gmail.com (Silvia Franceschi) Date: Fri, 14 Oct 2016 19:21:12 +0200 Subject: [Gvsig_english] How to access schema from an input shapefile in scripting In-Reply-To: <0c5d4af0-3c2e-3dd2-3b5a-ca481d5f4f92@gvsig.com> References: <0c5d4af0-3c2e-3dd2-3b5a-ca481d5f4f92@gvsig.com> Message-ID: I need to export the results of my elaborations of intersection in a new file, possibly not overwrite the old one. Thanks Silvia On Oct 14, 2016 4:29 PM, "?scar Mart?nez" wrote: > No problem at all! :) > > Sorry, i'm not sure what do you want to do.. create a new shapefile and > work with it? or export (make a copy) of a existing shapefile? > > El 14/10/16 a las 15:33, Silvia Franceschi escribi?: > > Hi ?scar, > always me.. :-) > is there also a way to write a layer in a shapefile directly from a script > or do I have to load it in gvSIG and save it from there? > > Thanks > > Silvia > > > On Fri, Oct 14, 2016 at 1:54 PM, Silvia Franceschi < > silvia.franceschi at gmail.com> wrote: > >> Thank you ?scar for your detailed explanation and your help! >> >> Silvia >> >> On Fri, Oct 14, 2016 at 11:59 AM, ?scar Mart?nez >> wrote: >> >>> Reading again your email maybe this also answer your question: >>> >>> Inside the script you can make a: print dir(layer) and it will show you >>> the avalaible functions of that type of object. >>> >>> El 14/10/16 a las 11:26, ?scar Mart?nez escribi?: >>> >>> Hi Silvia, >>> >>> >>> | Is there a way to know which functions are implemented for each >>> feature type in gvSIG scripting? >>> >>> If i understand correctly your question.. Quick answer, all. Since 2.3, >>> we are not working with a different library for scripting. We improved the >>> way to work directly with the JAVA API, plus new functions (like.. >>> createShape(schema)), methods (like.. getValues() over a feature to return >>> a python dict) and new classes (like.. FormPanel to create scripts with >>> graphical interface), all to make it easy and quick to work from scripting. >>> Not sure if is a good way to say it (just to explain this better), but we >>> could say right now is the java api who hasn't have all the funcions >>> implemented. >>> >>> As you can see in the script, type(layer) and type(features) are java >>> objects. >>> >>> Running script. >>> layer type: >> ers.vectorial.FLyrVect'> >>> layer features: >> pl.featureset.DefaultFeatureSet'> >>> Script terminated. >>> >>> So, you should be able to check the javadocs, and use all the functions >>> that are in there: >>> >>> http://downloads.gvsig.org/download/gvsig-desktop-testing/di >>> sts/2.3.0/javadocs/html/ >>> >>> http://downloads.gvsig.org/download/gvsig-desktop-testing/di >>> sts/2.3.0/javadocs/html/org/gvsig/fmap/mapcontext/layers/vec >>> torial/FLyrVect.html >>> >>> http://downloads.gvsig.org/download/gvsig-desktop-testing/di >>> sts/2.3.0/javadocs/html/org/gvsig/fmap/dal/feature/impl/feat >>> ureset/DefaultFeatureSet.html >>> >>> >>> Plus all from scripting (we are updating this javadoc, soon will be more >>> complete): >>> >>> http://downloads.gvsig.org/download/gvsig-desktop-testing/di >>> sts/2.3.0/docs/javadocs/html/ >>> >>> >>> Deleting features should be something similar to this (delete all >>> features with a filter "ID < 10"): >>> # encoding: utf-8 >>> >>> from gvsig import * >>> >>> def main(*args): >>> """ Delete features inside a layer""" >>> >>> layer = currentLayer() >>> features = layer.features("ID < 10") #DefaultFeatureSet >>> >>> >>> print "layer type: ", type(layer) >>> print "layer features: ", type(features) >>> >>> layer.edit() >>> >>> for i in features: >>> ivalues = i.getValues() >>> print ivalues >>> features.delete(i)#delete over the featureset >>> >>> layer.commit() >>> >>> >>> Best regards, >>> ?scar >>> >>> >>> El 14/10/16 a las 10:53, Silvia Franceschi escribi?: >>> >>> Hi ?scar, >>> the scripts work fine, many thanks again! >>> May I just ask you one more question? >>> Is there the possibility to remove a feature from a list of features? >>> like featureslist.remove() or something like that? >>> I tried with remove and delete but it seems that these do not exist, any >>> idea? >>> >>> Is there a way to know which functions are implemented for each feature >>> type in gvSIG scripting? >>> >>> Thanks >>> >>> Silvia >>> >>> >>> On Thu, Oct 13, 2016 at 6:25 PM, Silvia Franceschi < >>> silvia.franceschi at gmail.com> wrote: >>> >>>> Thank you ?scar, >>>> to tell you the truth I started to use currentLayer but, since I need >>>> to work with two layers I didn't know how to do and tried to load data from >>>> files. >>>> And in any case the final script should work with a list of shapefiles >>>> in a folder, so, I will for sure move to the file based data source at some >>>> point. >>>> >>>> I was following the documentation you linked, it is very useful to >>>> start to get familiar with the scripting environment, thanks! >>>> >>>> I will try the scripts you sent to me and let you know if I will solve >>>> my problems. >>>> >>>> Thank you very much for the quick answer! >>>> >>>> Silvia >>>> >>>> >>>> >>>> >>>> On Thu, Oct 13, 2016 at 6:00 PM, ?scar Mart?nez >>>> wrote: >>>> >>>>> Hi! >>>>> >>>>> If i understood correctly, you don't need to use the getSchema >>>>> function. I'm going to give you my solution with two test layers, give it a >>>>> try and tell us if that works for you or what exactly more do you need. If >>>>> you don't understand some part of the script i can explain it better. Some >>>>> help is inside the script, step by step. >>>>> >>>>> I recommend to you to start learning scripting using the functions >>>>> currentLayer() (current layer selection in the table of contents) or >>>>> currentView().getLayer("layername") instead of using loadShapeFile >>>>> everytime. It's easier if you just have a loaded layer in your view and >>>>> access to each one each layer with currentLayer o getLayer. >>>>> >>>>> If someone on the list want to know more about this part of scripting, >>>>> here are some links from the spanish docs (hope soon in english) related to >>>>> this post: >>>>> >>>>> Access to features: http://downloads.gvsig.org/dow >>>>> nload/web/html/es/scripting_devel_guide/2.3/acceso_a_objetos >>>>> .html#entidad >>>>> >>>>> Spatial operations: http://downloads.gvsig.org/dow >>>>> nload/web/html/es/scripting_devel_guide/2.3/modulo_geom.html >>>>> #operaciones-espaciales >>>>> >>>>> Current functions: http://downloads.gvsig.org/dow >>>>> nload/web/html/es/scripting_devel_guide/2.3/acceso_a_objetos.html >>>>> >>>>> >>>>> Any trouble here we are! >>>>> >>>>> >>>>> Best regards, >>>>> >>>>> ?scar >>>>> >>>>> >>>>> >>>>> Script (layers of this test are in EPSG:25830) (feature AREA1 is a >>>>> multipolygon): >>>>> >>>>> # encoding: utf-8 >>>>> >>>>> import gvsig >>>>> >>>>> def main(*args): >>>>> # You need to have one view with to layers opened on it >>>>> # The name of the layers will be the name that appear >>>>> # in the table of contents of the view >>>>> >>>>> # To access to the layers that are already loaded in gvSIG >>>>> # gvsig.currentView() give us access to the opened view >>>>> # gvsig.currentView().getLayer(name) give us access a specified >>>>> layer >>>>> points = gvsig.currentView().getLayer("points") >>>>> area = gvsig.currentView().getLayer("area") >>>>> >>>>> # Access to the features >>>>> features_points = points.features() >>>>> features_area = area.features() >>>>> >>>>> # if you want access to a selection of features, not all >>>>> # you will have to change `features()` with `getSelection()` >>>>> #features_points = points.getSelection() >>>>> #features_area = area.getSelection() >>>>> >>>>> for farea in features_area: >>>>> print "\nChecking : ", farea.get("localId") >>>>> geom_farea = farea.geometry() >>>>> >>>>> #for each area, check all points without intersection >>>>> for fpoint in features_points: >>>>> geom_fpoint = fpoint.geometry() >>>>> >>>>> if not geom_farea.intersects(geom_fpoint): >>>>> print "\tArea: ", farea.get("localId"), " intersects >>>>> with :", fpoint.get("ID") >>>>> # work with the feature >>>>> >>>>> Console output: >>>>> >>>>> Running script testing_silvia_intersec. >>>>> >>>>> Checking : AREA1 >>>>> Area: AREA1 intersects with : 101 >>>>> Area: AREA1 intersects with : 102 >>>>> Area: AREA1 intersects with : 103 >>>>> Area: AREA1 intersects with : 107 >>>>> >>>>> Checking : AREA2 >>>>> Area: AREA2 intersects with : 103 >>>>> Area: AREA2 intersects with : 104 >>>>> Area: AREA2 intersects with : 105 >>>>> Area: AREA2 intersects with : 106 >>>>> Area: AREA2 intersects with : 107 >>>>> Area: AREA2 intersects with : 108 >>>>> Script testing_silvia_intersec terminated. >>>>> >>>>> >>>>> >>>>> El 13/10/16 a las 15:05, Silvia Franceschi escribi?: >>>>> >>>>> Hi all, >>>>> I am trying to write my first script in gvSIG and Python, I need to >>>>> read a point shapefile and filter some elements that are outside a defined >>>>> area. >>>>> To do this I have to read two input layers, one with the points and >>>>> one with the area and then work on each single features of the point layer. >>>>> I started with the selection of the input layers using a filechooser >>>>> dialog (commonsdialog.filechooser) and then I need to obtain the schema of >>>>> these layers, but it seems that the object filechooser do not have the >>>>> .getSchema() function. >>>>> Do you have any idea on how to obtain the schema from a vector layer >>>>> selected using the filechooser? >>>>> >>>>> Thanks in advance for any help! >>>>> >>>>> Silvia >>>>> >>>>> >>>>> -- >>>>> ing. Silvia Franceschi >>>>> Via Latemar, 22 >>>>> 38030 Castello di Fiemme (TN) >>>>> >>>>> tel: 0039 -3384501332 <0039%20-3384501332> >>>>> >>>>> >>>>> _______________________________________________ >>>>> Gvsig_internacional mailing listGvsig_internacional at listserv.gva.es >>>>> >>>>> To see the archives, edit your preferences or unsubscribe from this mailing list, please access this url: >>>>> https://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional >>>>> >>>>> _______________________________________________ Gvsig_internacional >>>>> mailing list Gvsig_internacional at listserv.gva.es To see the archives, >>>>> edit your preferences or unsubscribe from this mailing list, please access >>>>> this url: https://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_inter >>>>> nacional >>>> >>>> -- >>>> ing. Silvia Franceschi Via Latemar, 22 >>>> 38030 Castello di Fiemme (TN) tel: 0039 -3384501332 >>>> >>> -- >>> ing. Silvia Franceschi Via Latemar, 22 >>> 38030 Castello di Fiemme (TN) tel: 0039 -3384501332 >>> >>> _______________________________________________ >>> Gvsig_internacional mailing listGvsig_internacional at listserv.gva.es >>> >>> To see the archives, edit your preferences or unsubscribe from this mailing list, please access this url: >>> https://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional >>> >>> _______________________________________________ >>> Gvsig_internacional mailing listGvsig_internacional at listserv.gva.es >>> >>> To see the archives, edit your preferences or unsubscribe from this mailing list, please access this url: >>> https://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional >>> >>> _______________________________________________ Gvsig_internacional >>> mailing list Gvsig_internacional at listserv.gva.es To see the archives, >>> edit your preferences or unsubscribe from this mailing list, please access >>> this url: https://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_inter >>> nacional >> >> -- >> ing. Silvia Franceschi Via Latemar, 22 >> 38030 Castello di Fiemme (TN) tel: 0039 -3384501332 >> > -- > ing. Silvia Franceschi Via Latemar, 22 > 38030 Castello di Fiemme (TN) tel: 0039 -3384501332 > > _______________________________________________ > Gvsig_internacional mailing listGvsig_internacional at listserv.gva.es > > To see the archives, edit your preferences or unsubscribe from this mailing list, please access this url: > https://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional > > > _______________________________________________ > Gvsig_internacional mailing list > Gvsig_internacional at listserv.gva.es > > To see the archives, edit your preferences or unsubscribe from this > mailing list, please access this url: > > https://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From omartinez at gvsig.com Tue Oct 18 18:13:32 2016 From: omartinez at gvsig.com (=?UTF-8?Q?=c3=93scar_Mart=c3=adnez?=) Date: Tue, 18 Oct 2016 18:13:32 +0200 Subject: [Gvsig_english] 3D vector layers In-Reply-To: References: Message-ID: <506c4eb8-c943-a2f0-5b2d-392cf6dbadc7@gvsig.com> Hi Silvia, Sorry with our last emails I forgot this one. So this two quick scripts: - a 2D point layer with a column of z of which I would create a 3D point layer # encoding: utf-8 import gvsig from gvsig import geom def main(*args): layer = gvsig.currentLayer() features = layer.features() #Create schema based on a existing schema sch = gvsig.createFeatureType(layer.getSchema()) #We modified the geometry field of that schema for the geometry type that we want sch.getDefaultGeometryAttribute().setGeometryType(geom.POINT, geom.D3) #new shape shp = gvsig.createShape(sch, prefixname="points3d") for feature in features: g = feature.geometry() #print g.getX(), g.getY(), feature.get("z") z = float(feature.get("z")) # z field convert to a float number (in my case was a string field) point3d = geom.createPoint(geom.D3, g.getX(), g.getY(), z) values = feature.getValues() values["GEOMETRY"] = point3d shp.append(values) shp.commit() gvsig.currentView().addLayer(shp) - a 2D line layer with a column containing the elevation of each corner of the line which I would create a 3D line layer. (*This script will be useful for lines and for polygons*, becouse their geometry works in the same way) # encoding: utf-8 import gvsig from gvsig import geom def main(*args): layer = gvsig.currentLayer() features = layer.features() #Create schema based on a existing schema sch = gvsig.createFeatureType(layer.getSchema()) #We modified the geometry field of that schema for the geometry type that we want sch.getDefaultGeometryAttribute().setGeometryType(geom.CURVE, geom.D3) #new shape shp = gvsig.createShape(sch, prefixname="linepol3d") for feature in features: z = float(feature.get("z")) # z field convert to a float number g = feature.geometry() # we will create a python list with all the vertexes linevertexes = [] # access to the vertexes of the geometry (line or pol is the same way) for vertex in g: p1 = geom.createPoint(geom.D3, vertex.getX(), vertex.getY(), z) linevertexes.append(p1) # create 3dline with this vertexes line3d = geom.createLine(geom.D3, linevertexes) print line3d values = feature.getValues() values["GEOMETRY"] = line3d shp.append(values) shp.commit() gvsig.currentView().addLayer(shp) Best regards, ?scar El 12/10/16 a las 14:44, Silvia Franceschi escribi?: > Dear all, > sorry for asking here, but I can not find any information about the > possibility to handle 3D vector layers (as shapefiles) in gvSIG. > Is it possible to create/modify a 3D vector layer (point, line) in gvSIG? > > I have two types of data to modify: > - a 2D point layer with a column of z of which I would create a 3D > point layer > - a 2D line layer with a column containing the elevation of each > corner of the line which I would create a 3D line layer. > > Any idea on how I can do? > > Thanks, > > Silvia > > -- > ing. Silvia Franceschi > Via Latemar, 22 > 38030 Castello di Fiemme (TN) > > tel: 0039 -3384501332 > > > _______________________________________________ > Gvsig_internacional mailing list > Gvsig_internacional at listserv.gva.es > > To see the archives, edit your preferences or unsubscribe from this mailing list, please access this url: > > https://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional -------------- next part -------------- An HTML attachment was scrubbed... URL: From omartinez at gvsig.com Wed Oct 19 11:00:56 2016 From: omartinez at gvsig.com (=?UTF-8?Q?=c3=93scar_Mart=c3=adnez?=) Date: Wed, 19 Oct 2016 11:00:56 +0200 Subject: [Gvsig_english] How to access schema from an input shapefile in scripting In-Reply-To: References: <0c5d4af0-3c2e-3dd2-3b5a-ca481d5f4f92@gvsig.com> Message-ID: <10d92645-4991-1f67-ee29-802d34b61eed@gvsig.com> In the 3D Points script it appears this full solution, creating a new shape to export the result. To create a new shape you will need something like this. You just will need to change the geometry type to adapt it to your needs: (Shape with a schema based on a existing layer) layer = gvsig.currentLayer() features = layer.features() #Create schema based on a existing schema sch = gvsig.createFeatureType(layer.getSchema()) #We modified the geometry field of that schema for the geometry type that we want sch.getDefaultGeometryAttribute().setGeometryType(geom.POINT, geom.D3) #new shape shp = gvsig.createShape(sch, prefixname="points3d") (New shape with new schema) #Create schema based on a existing schema sch = gvsig.createFeatureType(layer.getSchema()) sch.append("ID", "INTEGER", 10) sch.append("GEOMETRY", "GEOMETRY") #We modified the geometry field of that schema for the geometry type that we want sch.getDefaultGeometryAttribute().setGeometryType(geom.POINT, geom.D3) #new shape shp = gvsig.createShape(sch, prefixname="points3d") In this shape (that should be in editing mode because you just create it), you could directly append values, commit the changes, and add the layer to the View ... shp.append(values) shp.commit() gvsig.currentView().addLayer(shp) El 14/10/16 a las 19:21, Silvia Franceschi escribi?: > > I need to export the results of my elaborations of intersection in a > new file, possibly not overwrite the old one. > > Thanks > > Silvia > > > On Oct 14, 2016 4:29 PM, "?scar Mart?nez" > wrote: > > No problem at all! :) > > Sorry, i'm not sure what do you want to do.. create a new > shapefile and work with it? or export (make a copy) of a existing > shapefile? > > > El 14/10/16 a las 15:33, Silvia Franceschi escribi?: >> Hi ?scar, >> always me.. :-) >> is there also a way to write a layer in a shapefile directly from >> a script or do I have to load it in gvSIG and save it from there? >> >> Thanks >> >> Silvia >> >> >> On Fri, Oct 14, 2016 at 1:54 PM, Silvia Franceschi >> > > wrote: >> >> Thank you ?scar for your detailed explanation and your help! >> >> Silvia >> >> On Fri, Oct 14, 2016 at 11:59 AM, ?scar Mart?nez >> > wrote: >> >> Reading again your email maybe this also answer your >> question: >> >> Inside the script you can make a: print dir(layer) and it >> will show you the avalaible functions of that type of object. >> >> >> El 14/10/16 a las 11:26, ?scar Mart?nez escribi?: >>> >>> Hi Silvia, >>> >>> >>> | Is there a way to know which functions are >>> implemented for each feature type in gvSIG scripting? >>> >>> If i understand correctly your question.. Quick answer, >>> all. Since 2.3, we are not working with a different >>> library for scripting. We improved the way to work >>> directly with the JAVA API, plus new functions (like.. >>> createShape(schema)), methods (like.. getValues() over a >>> feature to return a python dict) and new classes (like.. >>> FormPanel to create scripts with graphical interface), >>> all to make it easy and quick to work from scripting. >>> Not sure if is a good way to say it (just to explain >>> this better), but we could say right now is the java api >>> who hasn't have all the funcions implemented. >>> >>> As you can see in the script, type(layer) and >>> type(features) are java objects. >>> >>> Running script. >>> layer type: >> 'org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect'> >>> layer features: >> pl.featureset.DefaultFeatureSet'> >>> Script terminated. >>> >>> So, you should be able to check the javadocs, and use >>> all the functions that are in there: >>> >>> http://downloads.gvsig.org/download/gvsig-desktop-testing/dists/2.3.0/javadocs/html/ >>> >>> >>> http://downloads.gvsig.org/download/gvsig-desktop-testing/dists/2.3.0/javadocs/html/org/gvsig/fmap/mapcontext/layers/vectorial/FLyrVect.html >>> >>> >>> http://downloads.gvsig.org/download/gvsig-desktop-testing/dists/2.3.0/javadocs/html/org/gvsig/fmap/dal/feature/impl/featureset/DefaultFeatureSet.html >>> >>> >>> >>> Plus all from scripting (we are updating this javadoc, >>> soon will be more complete): >>> >>> http://downloads.gvsig.org/download/gvsig-desktop-testing/dists/2.3.0/docs/javadocs/html/ >>> >>> >>> >>> Deleting features should be something similar to this >>> (delete all features with a filter "ID < 10"): >>> >>> # encoding: utf-8 >>> >>> from gvsig import * >>> >>> def main(*args): >>> """ Delete features inside a layer""" >>> >>> layer = currentLayer() >>> features = layer.features("ID < 10") #DefaultFeatureSet >>> >>> >>> print "layer type: ", type(layer) >>> print "layer features: ", type(features) >>> >>> layer.edit() >>> >>> for i in features: >>> ivalues = i.getValues() >>> print ivalues >>> features.delete(i)#delete over the featureset >>> >>> layer.commit() >>> >>> >>> Best regards, >>> ?scar >>> >>> >>> El 14/10/16 a las 10:53, Silvia Franceschi escribi?: >>>> Hi ?scar, >>>> the scripts work fine, many thanks again! >>>> May I just ask you one more question? >>>> Is there the possibility to remove a feature from a >>>> list of features? like featureslist.remove() or >>>> something like that? >>>> I tried with remove and delete but it seems that these >>>> do not exist, any idea? >>>> >>>> Is there a way to know which functions are implemented >>>> for each feature type in gvSIG scripting? >>>> >>>> Thanks >>>> >>>> Silvia >>>> >>>> >>>> On Thu, Oct 13, 2016 at 6:25 PM, Silvia Franceschi >>>> >>> > wrote: >>>> >>>> Thank you ?scar, >>>> to tell you the truth I started to use currentLayer >>>> but, since I need to work with two layers I didn't >>>> know how to do and tried to load data from files. >>>> And in any case the final script should work with a >>>> list of shapefiles in a folder, so, I will for sure >>>> move to the file based data source at some point. >>>> >>>> I was following the documentation you linked, it is >>>> very useful to start to get familiar with the >>>> scripting environment, thanks! >>>> >>>> I will try the scripts you sent to me and let you >>>> know if I will solve my problems. >>>> >>>> Thank you very much for the quick answer! >>>> >>>> Silvia >>>> >>>> >>>> >>>> >>>> On Thu, Oct 13, 2016 at 6:00 PM, ?scar Mart?nez >>>> > >>>> wrote: >>>> >>>> Hi! >>>> >>>> If i understood correctly, you don't need to >>>> use the getSchema function. I'm going to give >>>> you my solution with two test layers, give it a >>>> try and tell us if that works for you or what >>>> exactly more do you need. If you don't >>>> understand some part of the script i can >>>> explain it better. Some help is inside the >>>> script, step by step. >>>> >>>> I recommend to you to start learning scripting >>>> using the functions currentLayer() (current >>>> layer selection in the table of contents) or >>>> currentView().getLayer("layername") instead of >>>> using loadShapeFile everytime. It's easier if >>>> you just have a loaded layer in your view and >>>> access to each one each layer with currentLayer >>>> o getLayer. >>>> >>>> If someone on the list want to know more about >>>> this part of scripting, here are some links >>>> from the spanish docs (hope soon in english) >>>> related to this post: >>>> >>>> Access to features: >>>> http://downloads.gvsig.org/download/web/html/es/scripting_devel_guide/2.3/acceso_a_objetos.html#entidad >>>> >>>> >>>> Spatial operations: >>>> http://downloads.gvsig.org/download/web/html/es/scripting_devel_guide/2.3/modulo_geom.html#operaciones-espaciales >>>> >>>> >>>> Current functions: >>>> http://downloads.gvsig.org/download/web/html/es/scripting_devel_guide/2.3/acceso_a_objetos.html >>>> >>>> >>>> >>>> Any trouble here we are! >>>> >>>> >>>> Best regards, >>>> >>>> ?scar >>>> >>>> >>>> >>>> Script (layers of this test are in EPSG:25830) >>>> (feature AREA1 is a multipolygon): >>>> >>>> # encoding: utf-8 >>>> >>>> import gvsig >>>> >>>> def main(*args): >>>> # You need to have one view with to layers >>>> opened on it >>>> # The name of the layers will be the name >>>> that appear >>>> # in the table of contents of the view >>>> >>>> # To access to the layers that are already >>>> loaded in gvSIG >>>> # gvsig.currentView() give us access to the >>>> opened view >>>> # gvsig.currentView().getLayer(name) give >>>> us access a specified layer >>>> points = gvsig.currentView().getLayer("points") >>>> area = gvsig.currentView().getLayer("area") >>>> >>>> # Access to the features >>>> features_points = points.features() >>>> features_area = area.features() >>>> >>>> # if you want access to a selection of >>>> features, not all >>>> # you will have to change `features()` with >>>> `getSelection()` >>>> #features_points = points.getSelection() >>>> #features_area = area.getSelection() >>>> >>>> for farea in features_area: >>>> print "\nChecking : ", farea.get("localId") >>>> geom_farea = farea.geometry() >>>> >>>> #for each area, check all points >>>> without intersection >>>> for fpoint in features_points: >>>> geom_fpoint = fpoint.geometry() >>>> >>>> if not >>>> geom_farea.intersects(geom_fpoint): >>>> print "\tArea: ", >>>> farea.get("localId"), " intersects with :", >>>> fpoint.get("ID") >>>> # work with the feature >>>> >>>> Console output: >>>> >>>> Running script testing_silvia_intersec. >>>> >>>> Checking : AREA1 >>>> Area: AREA1 intersects with : 101 >>>> Area: AREA1 intersects with : 102 >>>> Area: AREA1 intersects with : 103 >>>> Area: AREA1 intersects with : 107 >>>> >>>> Checking : AREA2 >>>> Area: AREA2 intersects with : 103 >>>> Area: AREA2 intersects with : 104 >>>> Area: AREA2 intersects with : 105 >>>> Area: AREA2 intersects with : 106 >>>> Area: AREA2 intersects with : 107 >>>> Area: AREA2 intersects with : 108 >>>> Script testing_silvia_intersec terminated. >>>> >>>> >>>> >>>> El 13/10/16 a las 15:05, Silvia Franceschi >>>> escribi?: >>>>> Hi all, >>>>> I am trying to write my first script in gvSIG >>>>> and Python, I need to read a point shapefile >>>>> and filter some elements that are outside a >>>>> defined area. >>>>> To do this I have to read two input layers, >>>>> one with the points and one with the area and >>>>> then work on each single features of the point >>>>> layer. >>>>> I started with the selection of the input >>>>> layers using a filechooser dialog >>>>> (commonsdialog.filechooser) and then I need to >>>>> obtain the schema of these layers, but it >>>>> seems that the object filechooser do not have >>>>> the .getSchema() function. >>>>> Do you have any idea on how to obtain the >>>>> schema from a vector layer selected using the >>>>> filechooser? >>>>> >>>>> Thanks in advance for any help! >>>>> >>>>> Silvia >>>>> >>>>> >>>>> -- >>>>> ing. Silvia Franceschi >>>>> Via Latemar, 22 >>>>> 38030 Castello di Fiemme (TN) >>>>> >>>>> tel: 0039 -3384501332 >>>>> >>>>> >>>>> _______________________________________________ >>>>> Gvsig_internacional mailing list >>>>> Gvsig_internacional at listserv.gva.es >>>>> >>>>> >>>>> To see the archives, edit your preferences or unsubscribe from this mailing list, please access this url: >>>>> >>>>> https://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional >>>>> >>>> _______________________________________________ >>>> Gvsig_internacional mailing list >>>> Gvsig_internacional at listserv.gva.es >>>> To >>>> see the archives, edit your preferences or >>>> unsubscribe from this mailing list, please >>>> access this url: >>>> https://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional >>>> >>>> >>>> >>>> -- >>>> ing. Silvia Franceschi Via Latemar, 22 >>>> 38030 Castello di Fiemme (TN) tel: 0039 -3384501332 >>>> >>>> >>>> -- >>>> ing. Silvia Franceschi Via Latemar, 22 >>>> 38030 Castello di Fiemme (TN) tel: 0039 -3384501332 >>>> >>>> >>>> _______________________________________________ >>>> Gvsig_internacional mailing list >>>> Gvsig_internacional at listserv.gva.es >>>> >>>> >>>> To see the archives, edit your preferences or unsubscribe from this mailing list, please access this url: >>>> >>>> https://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional >>>> >>> >>> _______________________________________________ >>> Gvsig_internacional mailing list >>> Gvsig_internacional at listserv.gva.es >>> >>> >>> To see the archives, edit your preferences or unsubscribe from this mailing list, please access this url: >>> >>> https://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional >>> >> _______________________________________________ >> Gvsig_internacional mailing list >> Gvsig_internacional at listserv.gva.es >> To see the >> archives, edit your preferences or unsubscribe from this >> mailing list, please access this url: >> https://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional >> >> >> >> -- >> ing. Silvia Franceschi Via Latemar, 22 >> 38030 Castello di Fiemme (TN) tel: 0039 -3384501332 >> >> >> -- >> ing. Silvia Franceschi Via Latemar, 22 >> 38030 Castello di Fiemme (TN) tel: 0039 -3384501332 >> >> >> _______________________________________________ >> Gvsig_internacional mailing list >> Gvsig_internacional at listserv.gva.es >> >> >> To see the archives, edit your preferences or unsubscribe from this mailing list, please access this url: >> >> https://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional >> > _______________________________________________ > Gvsig_internacional mailing list > Gvsig_internacional at listserv.gva.es > To see the archives, > edit your preferences or unsubscribe from this mailing list, > please access this url: > https://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional > > > > _______________________________________________ > Gvsig_internacional mailing list > Gvsig_internacional at listserv.gva.es > > To see the archives, edit your preferences or unsubscribe from this mailing list, please access this url: > > https://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional -------------- next part -------------- An HTML attachment was scrubbed... URL: From lizbiogen at gmail.com Wed Oct 19 17:30:04 2016 From: lizbiogen at gmail.com (Lizandra Jaqueline Robe) Date: Wed, 19 Oct 2016 13:30:04 -0200 Subject: [Gvsig_english] Bioclimatic variables In-Reply-To: References: <9c99d562-341c-3b73-38b3-d479238a6cf8@gmail.com> Message-ID: Hi guys, What function should I use to produce a raster layer that represents the maximum or the minimum value for the bioclimatic variables among 12 months? Many thanks in advance! Lizandra 2016-10-05 9:15 GMT-03:00 Lizandra Jaqueline Robe : > Many thanks ?scar and Antonio! > I will try to execute these functions. > With all the best regards, > Lizandra > > 2016-10-05 5:26 GMT-03:00 Antonio Falciano : > >> Il 04/10/2016 20:22, Lizandra Jaqueline Robe ha scritto: >> >>> Hello guys, >>> I just came accross GVSIG, and I was wondering if it can be used to >>> construct bioclimatic variables from the new version 2 WorldClim data. >>> >> >> Hi Lizandra, >> gvSIG can be used for such task and many others, for sure! >> Firstly, you can download the available WorldClim variables by tile (in >> reference to your area of interest) and format (e.g. GeoTIFF) from the >> WorldClim website. Then you can calculate other variables of your >> interest combining them using the Raster Calculator available in the >> Processing toolbox. >> >> Cheers, >> Antonio >> >> -- >> Antonio Falciano >> http://www.linkedin.com/in/antoniofalciano >> >> _______________________________________________ >> Gvsig_internacional mailing list >> Gvsig_internacional at listserv.gva.es >> >> To see the archives, edit your preferences or unsubscribe from this >> mailing list, please access this url: >> >> https://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional >> > > > > -- > Lizandra Jaqueline Robe, Profa. Dra. > Universidade Federal do Rio Grande - FURG > Instituto de Ci?ncias Biol?gicas - ICB > -- Lizandra Jaqueline Robe, Profa. Dra. Universidade Federal do Rio Grande - FURG Instituto de Ci?ncias Biol?gicas - ICB -------------- next part -------------- An HTML attachment was scrubbed... URL: From antonio.falciano at gmail.com Thu Oct 20 10:15:11 2016 From: antonio.falciano at gmail.com (Antonio Falciano) Date: Thu, 20 Oct 2016 10:15:11 +0200 Subject: [Gvsig_english] Bioclimatic variables In-Reply-To: References: <9c99d562-341c-3b73-38b3-d479238a6cf8@gmail.com> Message-ID: Il 19/10/2016 17:30, Lizandra Jaqueline Robe ha scritto: > Hi guys, > What function should I use to produce a raster layer that represents the > maximum or the minimum value for the bioclimatic variables among 12 months? Hi Lizandra, you should use the "Maximum" (or "Minimum") geoprocess available in "Local statistics" group in the Geoprocessing toolbox. Here's an abstract from the help of the "Maximum" algorithm: *Description* This algorithms calculates the maximum value of each cell in a set of input layers. *Parameters* Layers[Multiple input]: The set of input layers Force no-data value[Boolean]: if this option is selected, the presence of a cell with no data value will cancel the calculation and assign the no-data value to the resulting cell . If this is not selected, cells with no data value will be ignored and the resulting value will be based only on valid data cells. *Outputs* Maximum[Raster layer]: Cheers, Antonio -- Antonio Falciano http://www.linkedin.com/in/antoniofalciano From antonio.falciano at gmail.com Thu Oct 20 10:30:35 2016 From: antonio.falciano at gmail.com (Antonio Falciano) Date: Thu, 20 Oct 2016 10:30:35 +0200 Subject: [Gvsig_english] 3D vector layers In-Reply-To: <506c4eb8-c943-a2f0-5b2d-392cf6dbadc7@gvsig.com> References: <506c4eb8-c943-a2f0-5b2d-392cf6dbadc7@gvsig.com> Message-ID: Il 18/10/2016 18:13, ?scar Mart?nez ha scritto: > Hi Silvia, > > Sorry with our last emails I forgot this one. > > So this two quick scripts: > > - a 2D point layer with a column of z of which I would create a 3D point > layer [...] > - a 2D line layer with a column containing the elevation of each corner > of the line which I would create a 3D line layer. > (*This script will be useful for lines and for polygons*, becouse their > geometry works in the same way) [...] Hi all, alternatively, as stated in my first post, it's possible to use only one script for all types of geometries (and eventually for other layer formats different from ESRI Shapefile) using ogr2ogr: # encoding: utf-8 from gvsig import * import os from gvsig import uselib uselib.use_plugin("org.gvsig.gdal.app.mainplugin") from org.gvsig.gdal.app.mainplugin.common import ogr2ogr def main(*args): layer = currentLayer() zfield = "ID" if layer != None: # get the input layer path (2D) datastore = layer.getDataStore() inLayerPath = datastore.getFullName() # get the output layer path (3D) dirname = os.path.dirname(inLayerPath) filename = os.path.basename(inLayerPath).split(".")[0] # for instance, we use the same file extension of the input layer # but it could be another OGR format (e.g. SpatiaLite) extension = os.path.basename(inLayerPath).split(".")[1] outLayerPath = os.path.join(dirname, filename + "_3D." + extension) if extension.lower() == "shp": format = "ESRI Shapefile" #elif extension.lower() == "..." # format = "..." else: print "Not implemented yet!" ogr2ogr.main(["-f", format, outLayerPath, inLayerPath, "-zfield", zfield, "-overwrite" ]) loadShapeFile(outLayerPath) Cheers, Antonio -- Antonio Falciano http://www.linkedin.com/in/antoniofalciano From lizbiogen at gmail.com Fri Oct 21 17:41:21 2016 From: lizbiogen at gmail.com (Lizandra Jaqueline Robe) Date: Fri, 21 Oct 2016 13:41:21 -0200 Subject: [Gvsig_english] Bioclimatic variables In-Reply-To: References: <9c99d562-341c-3b73-38b3-d479238a6cf8@gmail.com> Message-ID: Thank you very much, Antonio! I get all the raster I wanted. Now I'm looking for some function which allows me to extract the values of a raster by collection points. GvSig is able to give me that? With all the best regards, Lizandra 2016-10-20 6:15 GMT-02:00 Antonio Falciano : > Il 19/10/2016 17:30, Lizandra Jaqueline Robe ha scritto: > >> Hi guys, >> What function should I use to produce a raster layer that represents the >> maximum or the minimum value for the bioclimatic variables among 12 >> months? >> > > Hi Lizandra, > you should use the "Maximum" (or "Minimum") geoprocess available in > "Local statistics" group in the Geoprocessing toolbox. Here's an > abstract from the help of the "Maximum" algorithm: > > *Description* > This algorithms calculates the maximum value of each cell in a set of > input layers. > > *Parameters* > Layers[Multiple input]: The set of input layers > Force no-data value[Boolean]: if this option is selected, the presence > of a cell with no data value will cancel the calculation and assign the > no-data value to the resulting cell . If this is not selected, cells > with no data value will be ignored and the resulting value will be based > only on valid data cells. > > *Outputs* > Maximum[Raster layer]: > > > Cheers, > Antonio > > -- > Antonio Falciano > http://www.linkedin.com/in/antoniofalciano > _______________________________________________ > Gvsig_internacional mailing list > Gvsig_internacional at listserv.gva.es > > To see the archives, edit your preferences or unsubscribe from this > mailing list, please access this url: > > https://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional > -- Lizandra Jaqueline Robe, Profa. Dra. Universidade Federal do Rio Grande - FURG Instituto de Ci?ncias Biol?gicas - ICB -------------- next part -------------- An HTML attachment was scrubbed... URL: From antonio.falciano at gmail.com Fri Oct 21 17:53:51 2016 From: antonio.falciano at gmail.com (Antonio Falciano) Date: Fri, 21 Oct 2016 17:53:51 +0200 Subject: [Gvsig_english] Bioclimatic variables In-Reply-To: References: <9c99d562-341c-3b73-38b3-d479238a6cf8@gmail.com> Message-ID: <0d3c64d6-02ef-54b4-137a-1d8ffc710ca6@gmail.com> Il 21/10/2016 17:41, Lizandra Jaqueline Robe ha scritto: > Thank you very much, Antonio! I get all the raster I wanted. Don't mention it! > Now I'm looking for some function which allows me to extract the values > of a raster by collection points. GvSig is able to give me that? Yes, for sure. "Sample raster layers" (Tools for point layers) is the geoprocess to use in this case. Cheers, Antonio -- Antonio Falciano http://www.linkedin.com/in/antoniofalciano From lizbiogen at gmail.com Fri Oct 21 18:24:20 2016 From: lizbiogen at gmail.com (Lizandra Jaqueline Robe) Date: Fri, 21 Oct 2016 14:24:20 -0200 Subject: [Gvsig_english] Bioclimatic variables In-Reply-To: <0d3c64d6-02ef-54b4-137a-1d8ffc710ca6@gmail.com> References: <9c99d562-341c-3b73-38b3-d479238a6cf8@gmail.com> <0d3c64d6-02ef-54b4-137a-1d8ffc710ca6@gmail.com> Message-ID: This option is not available for me... I just charged the raster under vista and the coordinates under Table. Should I do something else: 2016-10-21 13:53 GMT-02:00 Antonio Falciano : > Il 21/10/2016 17:41, Lizandra Jaqueline Robe ha scritto: > >> Thank you very much, Antonio! I get all the raster I wanted. >> > > Don't mention it! > > Now I'm looking for some function which allows me to extract the values >> of a raster by collection points. GvSig is able to give me that? >> > > Yes, for sure. "Sample raster layers" (Tools for point layers) is the > geoprocess to use in this case. > > > Cheers, > Antonio > > -- > Antonio Falciano > http://www.linkedin.com/in/antoniofalciano > _______________________________________________ > Gvsig_internacional mailing list > Gvsig_internacional at listserv.gva.es > > To see the archives, edit your preferences or unsubscribe from this > mailing list, please access this url: > > https://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional > -- Lizandra Jaqueline Robe, Profa. Dra. Universidade Federal do Rio Grande - FURG Instituto de Ci?ncias Biol?gicas - ICB -------------- next part -------------- An HTML attachment was scrubbed... URL: From antonio.falciano at gmail.com Fri Oct 21 18:40:29 2016 From: antonio.falciano at gmail.com (Antonio Falciano) Date: Fri, 21 Oct 2016 18:40:29 +0200 Subject: [Gvsig_english] Bioclimatic variables In-Reply-To: References: <9c99d562-341c-3b73-38b3-d479238a6cf8@gmail.com> <0d3c64d6-02ef-54b4-137a-1d8ffc710ca6@gmail.com> Message-ID: <7f163c54-20fc-59bb-04b7-61dd7fba8e95@gmail.com> Il 21/10/2016 18:24, Lizandra Jaqueline Robe ha scritto: > This option is not available for me... I just charged the raster under > vista and the coordinates under Table. Should I do something else: The coordinates have be stored in a point layer in order to work with such geoprocess, so you should add an event theme (using the button near the Add layer one) based on the table first. Then you can use the geoprocess properly. Hope this helps. Cheers, Antonio -- Antonio Falciano http://www.linkedin.com/in/antoniofalciano From lizbiogen at gmail.com Fri Oct 21 19:34:29 2016 From: lizbiogen at gmail.com (Lizandra Jaqueline Robe) Date: Fri, 21 Oct 2016 15:34:29 -0200 Subject: [Gvsig_english] Bioclimatic variables In-Reply-To: <7f163c54-20fc-59bb-04b7-61dd7fba8e95@gmail.com> References: <9c99d562-341c-3b73-38b3-d479238a6cf8@gmail.com> <0d3c64d6-02ef-54b4-137a-1d8ffc710ca6@gmail.com> <7f163c54-20fc-59bb-04b7-61dd7fba8e95@gmail.com> Message-ID: Unfortunately, it did not work. I can't find "Sample raster layers" under the option "Tools for point layers"... 2016-10-21 14:40 GMT-02:00 Antonio Falciano : > Il 21/10/2016 18:24, Lizandra Jaqueline Robe ha scritto: > >> This option is not available for me... I just charged the raster under >> vista and the coordinates under Table. Should I do something else: >> > > The coordinates have be stored in a point layer in order to work with > such geoprocess, so you should add an event theme (using the button near > the Add layer one) based on the table first. Then you can use the > geoprocess properly. Hope this helps. > > > Cheers, > Antonio > > -- > Antonio Falciano > http://www.linkedin.com/in/antoniofalciano > _______________________________________________ > Gvsig_internacional mailing list > Gvsig_internacional at listserv.gva.es > > To see the archives, edit your preferences or unsubscribe from this > mailing list, please access this url: > > https://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional > -- Lizandra Jaqueline Robe, Profa. Dra. Universidade Federal do Rio Grande - FURG Instituto de Ci?ncias Biol?gicas - ICB -------------- next part -------------- An HTML attachment was scrubbed... URL: From antonio.falciano at gmail.com Fri Oct 21 19:50:40 2016 From: antonio.falciano at gmail.com (Antonio Falciano) Date: Fri, 21 Oct 2016 19:50:40 +0200 Subject: [Gvsig_english] Bioclimatic variables In-Reply-To: References: <9c99d562-341c-3b73-38b3-d479238a6cf8@gmail.com> <0d3c64d6-02ef-54b4-137a-1d8ffc710ca6@gmail.com> <7f163c54-20fc-59bb-04b7-61dd7fba8e95@gmail.com> Message-ID: <992ad3d4-43ac-4beb-38cf-f8a605ad49fc@gmail.com> Il 21/10/2016 19:34, Lizandra Jaqueline Robe ha scritto: > Unfortunately, it did not work. I can't find "Sample raster layers" > under the option "Tools for point layers"... ...in the Geoprocessing Toolbox? Which version of gvSIG and language are you using? Is it simply greyed out (bug) or is not available at all? https://postimg.org/image/ejglqwdt1/ Cheers, Antonio -- Antonio Falciano http://www.linkedin.com/in/antoniofalciano From lizbiogen at gmail.com Fri Oct 21 20:03:19 2016 From: lizbiogen at gmail.com (Lizandra Jaqueline Robe) Date: Fri, 21 Oct 2016 16:03:19 -0200 Subject: [Gvsig_english] Bioclimatic variables In-Reply-To: <992ad3d4-43ac-4beb-38cf-f8a605ad49fc@gmail.com> References: <9c99d562-341c-3b73-38b3-d479238a6cf8@gmail.com> <0d3c64d6-02ef-54b4-137a-1d8ffc710ca6@gmail.com> <7f163c54-20fc-59bb-04b7-61dd7fba8e95@gmail.com> <992ad3d4-43ac-4beb-38cf-f8a605ad49fc@gmail.com> Message-ID: It is not available at all... I'm using version 2.3.0.2447, in portuguese... 2016-10-21 15:50 GMT-02:00 Antonio Falciano : > Il 21/10/2016 19:34, Lizandra Jaqueline Robe ha scritto: > >> Unfortunately, it did not work. I can't find "Sample raster layers" >> under the option "Tools for point layers"... >> > > ...in the Geoprocessing Toolbox? Which version of gvSIG and language are > you using? Is it simply greyed out (bug) or is not available at all? > https://postimg.org/image/ejglqwdt1/ > > > Cheers, > Antonio > > -- > Antonio Falciano > http://www.linkedin.com/in/antoniofalciano > _______________________________________________ > Gvsig_internacional mailing list > Gvsig_internacional at listserv.gva.es > > To see the archives, edit your preferences or unsubscribe from this > mailing list, please access this url: > > https://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional > -- Lizandra Jaqueline Robe, Profa. Dra. Universidade Federal do Rio Grande - FURG Instituto de Ci?ncias Biol?gicas - ICB -------------- next part -------------- An HTML attachment was scrubbed... URL: From antonio.falciano at gmail.com Fri Oct 21 20:14:12 2016 From: antonio.falciano at gmail.com (Antonio Falciano) Date: Fri, 21 Oct 2016 20:14:12 +0200 Subject: [Gvsig_english] Bioclimatic variables In-Reply-To: References: <9c99d562-341c-3b73-38b3-d479238a6cf8@gmail.com> <0d3c64d6-02ef-54b4-137a-1d8ffc710ca6@gmail.com> <7f163c54-20fc-59bb-04b7-61dd7fba8e95@gmail.com> <992ad3d4-43ac-4beb-38cf-f8a605ad49fc@gmail.com> Message-ID: <5471540a-7a21-c853-e7d0-6376bdd982de@gmail.com> Il 21/10/2016 20:03, Lizandra Jaqueline Robe ha scritto: > It is not available at all... I'm using version 2.3.0.2447, in portuguese... Ok, so it should be "Mostrar camadas raster" under the "Ferramentas para camadas de pontos" group of SEXTANTE algorithms. Cheers, Antonio -- Antonio Falciano http://www.linkedin.com/in/antoniofalciano From lizbiogen at gmail.com Fri Oct 21 22:18:42 2016 From: lizbiogen at gmail.com (Lizandra Robe) Date: Fri, 21 Oct 2016 18:18:42 -0200 Subject: [Gvsig_english] Bioclimatic variables In-Reply-To: References: <9c99d562-341c-3b73-38b3-d479238a6cf8@gmail.com> <0d3c64d6-02ef-54b4-137a-1d8ffc710ca6@gmail.com> <7f163c54-20fc-59bb-04b7-61dd7fba8e95@gmail.com> <992ad3d4-43ac-4beb-38cf-f8a605ad49fc@gmail.com> Message-ID: <8D809DC8-38D9-4E86-9E11-7B0AB211E3F9@gmail.com> Thank you again, Antonio. Now I found the function... Enviado do meu iPhone > Em 21 de out de 2016, ?s 16:03, Lizandra Jaqueline Robe escreveu: > > It is not available at all... I'm using version 2.3.0.2447, in portuguese... > > 2016-10-21 15:50 GMT-02:00 Antonio Falciano : >> Il 21/10/2016 19:34, Lizandra Jaqueline Robe ha scritto: >>> Unfortunately, it did not work. I can't find "Sample raster layers" >>> under the option "Tools for point layers"... >> >> ...in the Geoprocessing Toolbox? Which version of gvSIG and language are >> you using? Is it simply greyed out (bug) or is not available at all? >> https://postimg.org/image/ejglqwdt1/ >> >> >> Cheers, >> Antonio >> >> -- >> Antonio Falciano >> http://www.linkedin.com/in/antoniofalciano >> _______________________________________________ >> Gvsig_internacional mailing list >> Gvsig_internacional at listserv.gva.es >> >> To see the archives, edit your preferences or unsubscribe from this mailing list, please access this url: >> >> https://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional > > > > -- > Lizandra Jaqueline Robe, Profa. Dra. > Universidade Federal do Rio Grande - FURG > Instituto de Ci?ncias Biol?gicas - ICB -------------- next part -------------- An HTML attachment was scrubbed... URL: From silvia.franceschi at gmail.com Tue Oct 25 14:09:22 2016 From: silvia.franceschi at gmail.com (Silvia Franceschi) Date: Tue, 25 Oct 2016 14:09:22 +0200 Subject: [Gvsig_english] 3D vector layers In-Reply-To: References: <506c4eb8-c943-a2f0-5b2d-392cf6dbadc7@gvsig.com> Message-ID: Thank you guys and sorry for the late reply! I will test these options on my data. Silvia On Thu, Oct 20, 2016 at 10:30 AM, Antonio Falciano < antonio.falciano at gmail.com> wrote: > Il 18/10/2016 18:13, ?scar Mart?nez ha scritto: > >> Hi Silvia, >> >> Sorry with our last emails I forgot this one. >> >> So this two quick scripts: >> >> - a 2D point layer with a column of z of which I would create a 3D point >> layer >> > > [...] > > - a 2D line layer with a column containing the elevation of each corner >> of the line which I would create a 3D line layer. >> (*This script will be useful for lines and for polygons*, becouse their >> geometry works in the same way) >> > > [...] > > > Hi all, > alternatively, as stated in my first post, it's possible to use only one > script for all types of geometries (and eventually for other layer > formats different from ESRI Shapefile) using ogr2ogr: > > # encoding: utf-8 > > from gvsig import * > import os > > from gvsig import uselib > uselib.use_plugin("org.gvsig.gdal.app.mainplugin") > from org.gvsig.gdal.app.mainplugin.common import ogr2ogr > > def main(*args): > > layer = currentLayer() > zfield = "ID" > if layer != None: > # get the input layer path (2D) > datastore = layer.getDataStore() > inLayerPath = datastore.getFullName() > > # get the output layer path (3D) > dirname = os.path.dirname(inLayerPath) > filename = os.path.basename(inLayerPath).split(".")[0] > # for instance, we use the same file extension of the input layer > # but it could be another OGR format (e.g. SpatiaLite) > extension = os.path.basename(inLayerPath).split(".")[1] > outLayerPath = os.path.join(dirname, filename + "_3D." + extension) > > if extension.lower() == "shp": > format = "ESRI Shapefile" > #elif extension.lower() == "..." > # format = "..." > else: > print "Not implemented yet!" > > ogr2ogr.main(["-f", format, > outLayerPath, > inLayerPath, > "-zfield", zfield, > "-overwrite" > ]) > > loadShapeFile(outLayerPath) > > > Cheers, > Antonio > > -- > Antonio Falciano > http://www.linkedin.com/in/antoniofalciano > _______________________________________________ > Gvsig_internacional mailing list > Gvsig_internacional at listserv.gva.es > > To see the archives, edit your preferences or unsubscribe from this > mailing list, please access this url: > > https://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional > -- ing. Silvia Franceschi Via Latemar, 22 38030 Castello di Fiemme (TN) tel: 0039 -3384501332 -------------- next part -------------- An HTML attachment was scrubbed... URL: From press at gvsig.com Wed Oct 26 11:41:12 2016 From: press at gvsig.com (gvSIG Press) Date: Wed, 26 Oct 2016 11:41:12 +0200 Subject: [Gvsig_english] gvSIG 2.3.1, a new gvSIG version with improvements oriented to cadastre Message-ID: <97b1dfcb-11b4-f000-6c6f-47bccc661406@gvsig.com> After publishing gvSIG 2.3 scarcely a month ago, a gvSIG version with a lot of new features [1], we announce a new version, gvSIG 2.3.1, with a small group of novelties oriented to make the work tasks related to cadastral information easy. This version can be downloaded from the project website [2]. At this way, the new plugin for GML importing and generation has been included, with INSPIRE format for Cadastre. At least in Spain, the General Management for Cadastre uses a GML format (XML with geographic contents) to describe cadastral parcels in IT field. The cadastral parcel format that has been used, achieves with the INSPIRE cadastral parcel standard defined in INSPIRE Data Specification on Cadastral Parcels ? Guidelines version 3.0.1. The current plugin for cadastral searching has been updated too, improving some usability issues. Taking advantage of this new version, several errors that have been detected by the gvSIG community have been fixed too, therefore we encourage users to update to this version. Finally, we remind you that all the gvSIG 2.3 documentation for users as well as for developers is available online [3]. [1] https://blog.gvsig.org/2016/09/30/gvsig-2-3-is-now-available/ [2] http://www.gvsig.com/en/products/gvsig-desktop/downloads [3] http://downloads.gvsig.org/download/web/html/en/index.html