I'm trying to serve a view of my table after passing a GeoJSON polygon.
Te idea is get all the points inside my polygon passed as GeoJSON.
For this, I've created new SQL view, and a query:
select p.id, p.nombre from points p, (select 1 as id, st_setSRID(st_GeomFromGeoJSON(%polygon%), 4326) as geom) as pol where st_within(p.geom, pol.geom)
polygon is the parameter I want to pass.
I'm getting the error
ERROR: unexpected end of data (at offset 0) when I'm trying to save the query in GeoServer.
The query is tested in PostGIS and running ok.
Any Idea what could be wrong?