scripting in gvsig 2.3: new features, improvements and...

44
Scripting in gvSIG 2.3: New features, improvements and enhancements Óscar Martínez Twitter: @masquesig Email: [email protected]

Upload: others

Post on 20-Aug-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Scripting in gvSIG 2.3: New features, improvements and ...downloads.gvsig.org/download/events/gvSIG-Festival/1st-gvSIG-Festi… · All of the gvSIG and Java power Doesn’t require

Scripting in gvSIG 2.3: New features,

improvements and enhancements

Óscar Martínez Twitter: @masquesig

Email: [email protected]

Page 2: Scripting in gvSIG 2.3: New features, improvements and ...downloads.gvsig.org/download/events/gvSIG-Festival/1st-gvSIG-Festi… · All of the gvSIG and Java power Doesn’t require

Scripting Module

Page 3: Scripting in gvSIG 2.3: New features, improvements and ...downloads.gvsig.org/download/events/gvSIG-Festival/1st-gvSIG-Festi… · All of the gvSIG and Java power Doesn’t require

Scripting Module

● Integrated programming module (IDE)● Create & Execute & Organize scripts ● Different allowed languages:

● Jython (Java + Python)● Groovy● R● .. and more

Page 4: Scripting in gvSIG 2.3: New features, improvements and ...downloads.gvsig.org/download/events/gvSIG-Festival/1st-gvSIG-Festi… · All of the gvSIG and Java power Doesn’t require

Scripts

● Scripts for:… create new geoprocess… automate tasks… develop new tools… add visual interface (Abeille)

● Access to all gvSIG functions

Page 5: Scripting in gvSIG 2.3: New features, improvements and ...downloads.gvsig.org/download/events/gvSIG-Festival/1st-gvSIG-Festi… · All of the gvSIG and Java power Doesn’t require

Scripting in gvSIG

Useful for:

Users

&

Developers

Page 6: Scripting in gvSIG 2.3: New features, improvements and ...downloads.gvsig.org/download/events/gvSIG-Festival/1st-gvSIG-Festi… · All of the gvSIG and Java power Doesn’t require

New features

Page 7: Scripting in gvSIG 2.3: New features, improvements and ...downloads.gvsig.org/download/events/gvSIG-Festival/1st-gvSIG-Festi… · All of the gvSIG and Java power Doesn’t require

Jython

● Updated version Jython 2.7.1 beta3more info: http://fwierzbicki.blogspot.com.es/

● Full compatibility with Java libraries … and some of Python (without C)

- add Python libs to:gvsig\gvSIG\extensiones\org.gvsig.scripting.app.mainplugin\scripting\lib

- or jars to: gvsig\gvSIG\extensiones\org.gvsig.scripting.app.mainplugin\lib

● Future: JyNI (compatibility with Numpy

and with almost all Python libraries) more info: http://jyni.org/

Page 8: Scripting in gvSIG 2.3: New features, improvements and ...downloads.gvsig.org/download/events/gvSIG-Festival/1st-gvSIG-Festi… · All of the gvSIG and Java power Doesn’t require

R

● R through Renjin- more info: http://www.renjin.org/Renjin is a JVM-based interpreter for the R language● Full integrated with Java/gvSIG● Not full integrated with R packages

● R native● Full integrated with R● Not full integrated with Java/gvSIG● One installation of R will come with gvSIG

Page 9: Scripting in gvSIG 2.3: New features, improvements and ...downloads.gvsig.org/download/events/gvSIG-Festival/1st-gvSIG-Festi… · All of the gvSIG and Java power Doesn’t require

GDAL

●GDAL integrated in gvSIG..so we can use gdal in our scriptshttp://gdal.org/java/

● Also, we could use:● Ogr2ogr● Gdaltranslate● ..

Page 10: Scripting in gvSIG 2.3: New features, improvements and ...downloads.gvsig.org/download/events/gvSIG-Festival/1st-gvSIG-Festi… · All of the gvSIG and Java power Doesn’t require

GeoprocessCall geoprocess that already exist inside gvSIG

Page 11: Scripting in gvSIG 2.3: New features, improvements and ...downloads.gvsig.org/download/events/gvSIG-Festival/1st-gvSIG-Festi… · All of the gvSIG and Java power Doesn’t require

Addons

Create Package (Addons) from Scripts

Page 12: Scripting in gvSIG 2.3: New features, improvements and ...downloads.gvsig.org/download/events/gvSIG-Festival/1st-gvSIG-Festi… · All of the gvSIG and Java power Doesn’t require

Visual Interfaces

Create Visual Interfaces with Abeille

Page 13: Scripting in gvSIG 2.3: New features, improvements and ...downloads.gvsig.org/download/events/gvSIG-Festival/1st-gvSIG-Festi… · All of the gvSIG and Java power Doesn’t require

Visual Interfaces

New lib development “FormPanel”

● Create easily visual interfaces

● Assign actions to buttons(action click)

● Manage listeners(action change)

Page 14: Scripting in gvSIG 2.3: New features, improvements and ...downloads.gvsig.org/download/events/gvSIG-Festival/1st-gvSIG-Festi… · All of the gvSIG and Java power Doesn’t require

Composer

IDE Improvements

Autocomplete(New: also with variables

names)

Tree scripts

Page 15: Scripting in gvSIG 2.3: New features, improvements and ...downloads.gvsig.org/download/events/gvSIG-Festival/1st-gvSIG-Festi… · All of the gvSIG and Java power Doesn’t require

Composer

IDE Improvements

● Threads Killer

● Code navigator

Page 16: Scripting in gvSIG 2.3: New features, improvements and ...downloads.gvsig.org/download/events/gvSIG-Festival/1st-gvSIG-Festi… · All of the gvSIG and Java power Doesn’t require

Composer

Replace

Page 17: Scripting in gvSIG 2.3: New features, improvements and ...downloads.gvsig.org/download/events/gvSIG-Festival/1st-gvSIG-Festi… · All of the gvSIG and Java power Doesn’t require

Composer

Search

Page 18: Scripting in gvSIG 2.3: New features, improvements and ...downloads.gvsig.org/download/events/gvSIG-Festival/1st-gvSIG-Festi… · All of the gvSIG and Java power Doesn’t require

Toolbox and Buttons

Add geoprocess to the Toolbox or as Buttons

Page 19: Scripting in gvSIG 2.3: New features, improvements and ...downloads.gvsig.org/download/events/gvSIG-Festival/1st-gvSIG-Festi… · All of the gvSIG and Java power Doesn’t require

Help documentation

Scripting and Javadocs

documentation

Page 20: Scripting in gvSIG 2.3: New features, improvements and ...downloads.gvsig.org/download/events/gvSIG-Festival/1st-gvSIG-Festi… · All of the gvSIG and Java power Doesn’t require

Imports

Import functions from others scripts or libs directly with import libname

Page 21: Scripting in gvSIG 2.3: New features, improvements and ...downloads.gvsig.org/download/events/gvSIG-Festival/1st-gvSIG-Festi… · All of the gvSIG and Java power Doesn’t require

Use plugin & jar

Use plugins already installed inside gvSIG

(use_plugin)

Use new jars from outside gvSIGJava (jars)(use_jar)

Page 22: Scripting in gvSIG 2.3: New features, improvements and ...downloads.gvsig.org/download/events/gvSIG-Festival/1st-gvSIG-Festi… · All of the gvSIG and Java power Doesn’t require

Libraries

Included some libraries:

- geopy: address geocodification- jOpenDocument: reports- cartodb: upload files and more

Page 23: Scripting in gvSIG 2.3: New features, improvements and ...downloads.gvsig.org/download/events/gvSIG-Festival/1st-gvSIG-Festi… · All of the gvSIG and Java power Doesn’t require

WorldWind View PluginStill not fully developed: Accessing to the 3D View

from scriptsIt will be a big feature

Page 24: Scripting in gvSIG 2.3: New features, improvements and ...downloads.gvsig.org/download/events/gvSIG-Festival/1st-gvSIG-Festi… · All of the gvSIG and Java power Doesn’t require

Big Improvements

Page 25: Scripting in gvSIG 2.3: New features, improvements and ...downloads.gvsig.org/download/events/gvSIG-Festival/1st-gvSIG-Festi… · All of the gvSIG and Java power Doesn’t require

Jython

● Updated libraries (gvsig and geom)● All the module has been updated● We tried don’t lose compatibility (same syntax)

● New approached to gvsig lib:Improve Java API with Python functions

Page 26: Scripting in gvSIG 2.3: New features, improvements and ...downloads.gvsig.org/download/events/gvSIG-Festival/1st-gvSIG-Festi… · All of the gvSIG and Java power Doesn’t require

Jython

Before (gvSIG 2.2)

● Less powerful● Requires a lot of development● Rewrite all classes (mix of Python and Java Classes)● Hard if one method doesn’t exist

After (gvSIG 2.3 and more)

● All of the gvSIG and Java power● Doesn’t require big developments● All gvSIG Objects are Java● Added Python methods to Java classes

Page 27: Scripting in gvSIG 2.3: New features, improvements and ...downloads.gvsig.org/download/events/gvSIG-Festival/1st-gvSIG-Festi… · All of the gvSIG and Java power Doesn’t require

Jython

So.. you could use directly all Java classes and methods from the Javadocs

+ Pythons functions and methods that will make your scripts so easy to develop and maintain

Page 28: Scripting in gvSIG 2.3: New features, improvements and ...downloads.gvsig.org/download/events/gvSIG-Festival/1st-gvSIG-Festi… · All of the gvSIG and Java power Doesn’t require

Development examples

Page 29: Scripting in gvSIG 2.3: New features, improvements and ...downloads.gvsig.org/download/events/gvSIG-Festival/1st-gvSIG-Festi… · All of the gvSIG and Java power Doesn’t require

Intersection

“Es decir elijo la capa [...] pedir que se interseque con otras capas y que me indique cuáles de esos puntos se encuentran dentro de una cuenca hidrográfica, un área protegida, una provincia, entre otros¿existe alguna forma de hacer esto automatizado?”

Page 30: Scripting in gvSIG 2.3: New features, improvements and ...downloads.gvsig.org/download/events/gvSIG-Festival/1st-gvSIG-Festi… · All of the gvSIG and Java power Doesn’t require

geopy

Page 31: Scripting in gvSIG 2.3: New features, improvements and ...downloads.gvsig.org/download/events/gvSIG-Festival/1st-gvSIG-Festi… · All of the gvSIG and Java power Doesn’t require

Monitor

Page 32: Scripting in gvSIG 2.3: New features, improvements and ...downloads.gvsig.org/download/events/gvSIG-Festival/1st-gvSIG-Festi… · All of the gvSIG and Java power Doesn’t require

Coordinates

Page 33: Scripting in gvSIG 2.3: New features, improvements and ...downloads.gvsig.org/download/events/gvSIG-Festival/1st-gvSIG-Festi… · All of the gvSIG and Java power Doesn’t require

Ideya

Page 34: Scripting in gvSIG 2.3: New features, improvements and ...downloads.gvsig.org/download/events/gvSIG-Festival/1st-gvSIG-Festi… · All of the gvSIG and Java power Doesn’t require

CartoDB

https://github.com/CartoDB/cartodb-python

Page 35: Scripting in gvSIG 2.3: New features, improvements and ...downloads.gvsig.org/download/events/gvSIG-Festival/1st-gvSIG-Festi… · All of the gvSIG and Java power Doesn’t require

jOpenDocument

Page 36: Scripting in gvSIG 2.3: New features, improvements and ...downloads.gvsig.org/download/events/gvSIG-Festival/1st-gvSIG-Festi… · All of the gvSIG and Java power Doesn’t require

Java Topology Suite (JTS)

Page 37: Scripting in gvSIG 2.3: New features, improvements and ...downloads.gvsig.org/download/events/gvSIG-Festival/1st-gvSIG-Festi… · All of the gvSIG and Java power Doesn’t require

jgrasstools

Page 38: Scripting in gvSIG 2.3: New features, improvements and ...downloads.gvsig.org/download/events/gvSIG-Festival/1st-gvSIG-Festi… · All of the gvSIG and Java power Doesn’t require

SQL Console

Page 39: Scripting in gvSIG 2.3: New features, improvements and ...downloads.gvsig.org/download/events/gvSIG-Festival/1st-gvSIG-Festi… · All of the gvSIG and Java power Doesn’t require

Game

Page 40: Scripting in gvSIG 2.3: New features, improvements and ...downloads.gvsig.org/download/events/gvSIG-Festival/1st-gvSIG-Festi… · All of the gvSIG and Java power Doesn’t require

Automate maps creation

Page 41: Scripting in gvSIG 2.3: New features, improvements and ...downloads.gvsig.org/download/events/gvSIG-Festival/1st-gvSIG-Festi… · All of the gvSIG and Java power Doesn’t require

Geotagging Digital Photos

Page 42: Scripting in gvSIG 2.3: New features, improvements and ...downloads.gvsig.org/download/events/gvSIG-Festival/1st-gvSIG-Festi… · All of the gvSIG and Java power Doesn’t require

Scripts from MOOC students

Enseñanza de la geografía política mediante ejercicios y juegos(Manuel Maria Alvarez)

Column Statistics(Piotr Pachól)

Importador / Exportador de geojson a shapes(Jose Alberto Gonzalez y Francisco Puga)

Crear copia de capa con los campos deseados y en orden(Jose Luis Lopez Janas)

Reporte de viaje del servicio Sub-urbano Asunción-Ypacarai del FCPPCAL y ubicación en el tiempo

(Sergio Spiridonoff Reyes)

Sinuosity Index Schumm classification(Carles Clua Millan)

Page 43: Scripting in gvSIG 2.3: New features, improvements and ...downloads.gvsig.org/download/events/gvSIG-Festival/1st-gvSIG-Festi… · All of the gvSIG and Java power Doesn’t require

More info:

● Mooc: Scripting in gvSIG

● Blog gvSIGhttp://blog.gvsig.org/

● Outreach: Scripts exampleshttp://outreach.gvsig.org/scripts/

●Emails lists: Users and developershttp://www.gvsig.com/es/comunidad/listas-de-correo