Hi,
currently the Python scripting process lacks a bit behind the Java counterpart
in terms of what metadata can be provided for the process input parameters.
As far a I can see, the syntax only allows for type and description:
@process(
…,
inputs={ ‘geom’: (Geometry, ‘The geometry to buffer’),
‘distance’: (float,‘The buffer distance’)},
outputs={‘result’: (Geometry, ‘The buffered geometry’)}
)
I would like to add more to that, in particular, to get started,
whether the parameter is optional, an eventual default value,
and a list of valid values for that parameter, if any (for those
we’d use the Parameter.OPTIONS key, already in use in datastores
for lists with limited values).
Now, the current setup is positional, the above would add three new
possible elements to add, and more might come in the future (think
ways to describe collections for example).
In that light, I was wondering if for any extra parameter we could break
off the positional approach and use a key value pair approach instead.
Here is a possible example (just to get the discussion started, I’m
open to suggestions and might come up with more approaches later):
@process(
…,
inputs={ ‘geom’: (Geometry, ‘The geometry to buffer’),
‘distance’: (float,‘The buffer distance’),
‘capStyle’: (String, ‘The style of buffer endings’, {‘min’: 0, ‘default’: ‘round’, ‘options’ : ('‘round’, ‘flat’, ‘square’)})
‘quadrangSegments’: (integer, 'Number of segments , {‘min’: 0, ‘default’: 8})
},
outputs={‘result’: (Geometry, ‘The buffered geometry’)}
)
What do you think?
Cheers
Andrea
–
==
Meet us at GEO Business 2014! in London! Visit http://goo.gl/fES3aK
for more information.
Ing. Andrea Aime
@geowolf
Technical Lead
GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549
http://www.geo-solutions.it
http://twitter.com/geosolutions_it