Re: [Geoserver-users] WPS plugin issue/usage

2024-04-11 Thread Andrea Aime
Hi David,
the JTS:centroid takes a single geometry and computes its centroid.
In both cases instead you're feeding it a feature collection, that list, a
list of features, where each feature is geometry + attributes.

So, you're giving it something much more complex than what it's prepared to
process.
Something like this would work instead:

http://www.w3.org/2001/XMLSchema-instance;
xmlns="http://www.opengis.net/wps/1.0.0;
xmlns:wfs="http://www.opengis.net/wfs;
xmlns:wps="http://www.opengis.net/wps/1.0.0;
xmlns:ows="http://www.opengis.net/ows/1.1;
xmlns:gml="http://www.opengis.net/gml;
xmlns:ogc="http://www.opengis.net/ogc;
xmlns:wcs="http://www.opengis.net/wcs/1.1.1;
xmlns:xlink="http://www.w3.org/1999/xlink;
xsi:schemaLocation="http://www.opengis.net/wps/1.0.0
http://schemas.opengis.net/wps/1.0.0/wpsAll.xsd;>
  JTS:centroid
  

  geom
  

  

  

  
  

  result

  


I'm giving the process what it's expecting: a polygon (would work with any
other geometry type as well, as long as they are just geometries).

Regards,

Andrea Aime


==
GeoServer Professional Services from the experts!

Visit http://bit.ly/gs-services-us for more information.
==

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions Group
phone: +39 0584 962313

fax: +39 0584 1660272

mob:   +39  339 8844549

https://www.geosolutionsgroup.com/

http://twitter.com/geosolutions_it

---

Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE
2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si
precisa che ogni circostanza inerente alla presente email (il suo
contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è
riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il
messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra
operazione è illecita. Le sarei comunque grato se potesse darmene notizia.

This email is intended only for the person or entity to which it is
addressed and may contain information that is privileged, confidential or
otherwise protected from disclosure. We remind that - as provided by
European Regulation 2016/679 “GDPR” - copying, dissemination or use of this
e-mail or the information herein by anyone other than the intended
recipient is prohibited. If you have received this email by mistake, please
notify us immediately by telephone or e-mail


On Thu, Apr 4, 2024 at 1:05 PM David Alvey (Corporate Services and
Transformation) via Geoserver-users 
wrote:

> Hi
>
> I have installed the WPS extension in geoserver 2.21.1 but not sure if my
> query is wrong or the installation has failed.
>
> The heatmap tiles do render but when running a centroid query by Posting
> the following to https://wms.derbyshire.gov.uk/geoserver/ows?strict=true
>
>
>  service="WPS" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
> xmlns="http://www.opengis.net/wps/1.0.0; xmlns:wfs="
> http://www.opengis.net/wfs; xmlns:wps="http://www.opengis.net/wps/1.0.0;
> xmlns:ows="http://www.opengis.net/ows/1.1; xmlns:gml="
> http://www.opengis.net/gml; xmlns:ogc="http://www.opengis.net/ogc;
> xmlns:wcs="http://www.opengis.net/wcs/1.1.1; xmlns:xlink="
> http://www.w3.org/1999/xlink; xsi:schemaLocation="
> http://www.opengis.net/wps/1.0.0
> http://schemas.opengis.net/wps/1.0.0/wpsAll.xsd;>
>   JTS:centroid
>   
> 
>   geom
>   https://wms.derbyshire.gov.uk/geoserver/DCC/ows?service=WFSversion=1.0.0request=GetFeaturetypeName=DCC%3AMotorbike_Accidents_2022maxFeatures=50outputFormat=application%2FjsonpropertyName=the_geom;
> method="GET"/>
> 
>   
>   
> 
>   result
> 
>   
> 
>
> I get
>
> 
> http://www.w3.org/2001/XMLSchema;
> xmlns:ows="http://www.opengis.net/ows/1.1; xmlns:wps="
> http://www.opengis.net/wps/1.0.0; xmlns:xlink="
> http://www.w3.org/1999/xlink; xml:lang="en" service="WPS"
> serviceInstance="http://wms.derbyshire.gov.uk/geoserver/ows?;
> version="1.0.0">
> 
> JTS:centroid
> Centroid
> Returns the geometric centroid of a geometry. Output
> is a single point.  The centroid point may be located outside the
> geometry.
> 
> 
> 
> 
>  locator="geom">
> Failed to retrieve value for input
> geom
> 
> 
> 
> 
> 
>
> The actual name of the geometry column is the_geom but tried changing the
> identifier and get (this does get logged)
>
> 
> http://www.w3.org/2001/XMLSchema;
> xmlns:ows="http://www.opengis.net/ows/1.1; xmlns:xsi="
> http://www.w3.org/2001/XMLSchema-instance; version="1.1.0"
> xsi:schemaLocation="http://www.opengis.net/ows/1.1
> http://wms.derbyshire.gov.uk/geoserver/schemas/ows/1.1.0/owsAll.xsd;>
> 
> No such parameter: the_geom
> 
> 
>
> The xml was generated using the "Demos" tab in the geoserver instance.
> Unfortunately due to our server setup I can only test via 

[Geoserver-users] WPS plugin issue/usage

2024-04-04 Thread David Alvey (Corporate Services and Transformation) via Geoserver-users
Hi

I have installed the WPS extension in geoserver 2.21.1 but not sure if my query 
is wrong or the installation has failed.

The heatmap tiles do render but when running a centroid query by Posting the 
following to https://wms.derbyshire.gov.uk/geoserver/ows?strict=true


http://www.w3.org/2001/XMLSchema-instance; 
xmlns="http://www.opengis.net/wps/1.0.0; xmlns:wfs="http://www.opengis.net/wfs; 
xmlns:wps="http://www.opengis.net/wps/1.0.0; 
xmlns:ows="http://www.opengis.net/ows/1.1; 
xmlns:gml="http://www.opengis.net/gml; xmlns:ogc="http://www.opengis.net/ogc; 
xmlns:wcs="http://www.opengis.net/wcs/1.1.1; 
xmlns:xlink="http://www.w3.org/1999/xlink; 
xsi:schemaLocation="http://www.opengis.net/wps/1.0.0 
http://schemas.opengis.net/wps/1.0.0/wpsAll.xsd;>
  JTS:centroid
  

  geom
  https://wms.derbyshire.gov.uk/geoserver/DCC/ows?service=WFSversion=1.0.0request=GetFeaturetypeName=DCC%3AMotorbike_Accidents_2022maxFeatures=50outputFormat=application%2FjsonpropertyName=the_geom;
 method="GET"/>

  
  

  result

  


I get


http://www.w3.org/2001/XMLSchema; 
xmlns:ows="http://www.opengis.net/ows/1.1; 
xmlns:wps="http://www.opengis.net/wps/1.0.0; 
xmlns:xlink="http://www.w3.org/1999/xlink; xml:lang="en" service="WPS" 
serviceInstance="http://wms.derbyshire.gov.uk/geoserver/ows?; version="1.0.0">

JTS:centroid
Centroid
Returns the geometric centroid of a geometry. Output is a 
single point.  The centroid point may be located outside the 
geometry.





Failed to retrieve value for input 
geom






The actual name of the geometry column is the_geom but tried changing the 
identifier and get (this does get logged)


http://www.w3.org/2001/XMLSchema; 
xmlns:ows="http://www.opengis.net/ows/1.1; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; version="1.1.0" 
xsi:schemaLocation="http://www.opengis.net/ows/1.1 
http://wms.derbyshire.gov.uk/geoserver/schemas/ows/1.1.0/owsAll.xsd;>

No such parameter: the_geom



The xml was generated using the "Demos" tab in the geoserver instance. 
Unfortunately due to our server setup I can only test via Postman.

I have tried lots of permutations but can only assume that my query is wrong, 
dataset has issues, plugin has issues or our network is causing me grief. I 
have also tried passing in json

The layers I have used are live and public.

This is not what I want to achieve but I also tried feeding a point in
http://www.w3.org/2001/XMLSchema-instance; 
xmlns="http://www.opengis.net/wps/1.0.0; xmlns:wfs="http://www.opengis.net/wfs; 
xmlns:wps="http://www.opengis.net/wps/1.0.0; 
xmlns:ows="http://www.opengis.net/ows/1.1; 
xmlns:gml="http://www.opengis.net/gml; xmlns:ogc="http://www.opengis.net/ogc; 
xmlns:wcs="http://www.opengis.net/wcs/1.1.1; 
xmlns:xlink="http://www.w3.org/1999/xlink; 
xsi:schemaLocation="http://www.opengis.net/wps/1.0.0 
http://schemas.opengis.net/wps/1.0.0/wpsAll.xsd;>
  JTS:centroid
  

  geom
  

  

  
  

  result

  


And got


http://www.w3.org/2001/XMLSchema; 
xmlns:ows="http://www.opengis.net/ows/1.1; 
xmlns:wps="http://www.opengis.net/wps/1.0.0; 
xmlns:xlink="http://www.w3.org/1999/xlink; xml:lang="en" service="WPS" 
serviceInstance="http://wms.derbyshire.gov.uk/geoserver/ows?; version="1.0.0">

JTS:centroid
Centroid
Returns the geometric centroid of a geometry. Output is a 
single point.  The centroid point may be located outside the 
geometry.





Failed to retrieve value for input geom
Cannot invoke 
quot;com.fasterxml.jackson.core.ObjectCodec.readTree(com.fasterxml.jackson.core.JsonParser)quot;
 because quot;ocquot; is null






I would appreciate any help anyone could offer or pointing to another list if 
more appropriate.


The cold weather can cause problems for older and more vulnerable people. Get 
advice and support on how to Stay Well This Winter. Find out more on our 
website 
here.

Think before you print! Save energy and paper. Do you really need to print this 
email?

Derbyshire County Council works to improve the lives of local people by 
delivering high quality services. You can find out more about us by visiting 
www.derbyshire.gov.uk.
If you want to work for us go to our job pages on 
www.derbyshire.gov.uk/jobs. You can register 
for e-mail alerts, download job packs and apply on-line.



Please Note
This email is confidential, may be legally privileged and may contain personal 
views that are