If GeoServer doesn't have anything already, another option would be
to create a custom function to load a feature collection based on
the layer name, similar to what the cross-layer filtering plugin
does. That plugin just returns a geometry, but you could instead
return the whole feature collection. See:
https://github.com/geoserver/geoserver/blob/43b3a6fc6ce3a99e70510ea2d570e09069901f2f/src/extension/querylayer/src/main/java/org/geoserver/filter/function/QueryFunction.java
https://github.com/geoserver/geoserver/blob/43b3a6fc6ce3a99e70510ea2d570e09069901f2f/src/extension/querylayer/src/main/java/org/geoserver/filter/function/QueryLayerFunctionFactory.java
Thanks,
Emilio
On 7/8/19 4:19 PM, Ankur Agrawal wrote:
Hi,
Thanks Jim and Emilio for the answers.
I've already tried to hard code the secondary layer source
in SLD but it doesn't get recognised.
I tried this:
<ogc:Function
name="parameter">
<ogc:Literal> secondary
</ogc:Literal>
<ogc:Literal> ws:layer2
</ogc:Literal>
And it gave me the following error:
internal error,Rendering process
failed.
could not convert ws:layer2 into the
expected interface
org.geotools.data.simple.SimpleFeatureCollection
Also, as Emilio pointed out data is the parameter
corresponding to DensityProcess Class. In Join function, we
have primary,secondary ,JoinAttribute as parameters.(PFA for
reference).
I am not using request builder with XML input as it would
give the output in form of Json/xml but my aim is to get the
output in form of WMS layer.
Let me know if there is any other way I can hard code the
secondary layer. Meanwhile, I'll explore Cross Layer
Filtering and also ask on geoserver users' list.
Thanks.
Ankur
I think the 'data' parameter
corresponds to the name in the DensityProcess class. It
seems like it gets filled in with the current layer
automatically, but there might be a way to reference a
different layer. It seems that the SLD will only accept ogc
functions - there is a 'Query' function in geoserver, but I
can't find any documentation on it. Theoretically, you might
be able to pass it a layer name, similar to the cross-layer
filtering or: https://github.com/locationtech/geomesa/blob/master/geomesa-accumulo/geomesa-accumulo-datastore/src/test/resources/process/arrow.xml#L18
I would suggest that you ask on the geoserver users' list,
as someone there might know if it's possible.
Thanks,
Emilio
On
7/8/19 3:05 PM, Jim Hughes wrote:
Hi Ankur,
This is a good question. I haven't thought to try the
geomesa:Join WPS in a Style. The good news is that it
ought to work.
If you can make it work in the WPS Request Builder, you
likely have the XML/input for both layers. If one of
those is static, you could hardcode it into the SLD for
the secondary source.
From looking at the code for the DensityProcess and
heatmap[1], it looks like the SLD might have a literal
called 'data' which represents the WMS request. That
might give you some room to select what should be from
GeoMesa in C*.
Perhaps you take a look at the source for the
DensityProcess, the SLD, and the JoinProcess to see if
you can find another idea or two to try?
The idea of joining makes me think of the GeoServer
Cross-Layer Filtering plugin[2]. That may or may not
apply here.
Cheers,
Jim
1. https://github.com/locationtech/geomesa/blob/master/geomesa-process/geomesa-process-vector/src/main/scala/org/locationtech/geomesa/process/analytic/DensityProcess.scala
https://github.com/locationtech/geomesa/blob/master/docs/tutorials/_static/geomesa-quickstart-storm/heatmap.sld
https://github.com/locationtech/geomesa/blob/master/geomesa-process/geomesa-process-vector/src/main/scala/org/locationtech/geomesa/process/query/JoinProcess.scala
2. https://docs.geoserver.org/stable/en/user/extensions/querylayer/index.html
On
7/8/19 5:53 AM, Ankur Agarwal wrote:
Hi All,
I am using geomesa-Cassandra with geoserver. I
want to join two tables (spatial-spatial or
spatial-temporal) and get the output as WMS layer.
For this, I was trying to use geomesa:Join function of
WPS plugin in GeoServer. It works fine if I use it in
Demos-WPS request Builder. But to get WMS layer
output, I was using it in Transformation tag in SLD
styles.
I am unable to figure out how to provide two layers
as input as I can assign this style to one layer and
that layer is only getting passed in as input layer.
Please suggest how to pass two layers as input in
this function.or Is there any better method to join
two tables in geomesa-cassandra and get the output
as WMS layer?
PFA for reference.
Thanks.
Ankur
_______________________________________________
geomesa-users mailing list
geomesa-users@xxxxxxxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.locationtech.org/mailman/listinfo/geomesa-users
_______________________________________________
geomesa-users mailing list
geomesa-users@xxxxxxxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.locationtech.org/mailman/listinfo/geomesa-users
_______________________________________________
geomesa-users mailing list
geomesa-users@xxxxxxxxxxxxxxxx
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://dev.locationtech.org/mailman/listinfo/geomesa-users
_______________________________________________
geomesa-users mailing list
geomesa-users@xxxxxxxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.locationtech.org/mailman/listinfo/geomesa-users
|