I have no more idea in how to run this query:
SELECT row_to_json(fc)::text
FROM (SELECT 'FeatureCollection' As type, array_to_json(array_agg(f)) As features
FROM (SELECT 'Feature' As type,
ST_AsGeoJSON(ST_Transform(lg.geom,4326))\\:\\:json As geometry,
(
select row_to_json(t)
from (select comune) t
)
As properties
FROM comuni_2015 As lg WHERE id >= 0 ) As f ) As fc LIMIT 10
This is what I'm trying to do:
return (Geomcomuni) getSession().createQuery(query);
"SELECT row_to_json(fc)::text \n" +
"FROM (SELECT 'FeatureCollection' As type, array_to_json(array_agg(f)) As features \n" +
"FROM (SELECT 'Feature' As type, \n" +
"ST_AsGeoJSON(ST_Transform(lg.geom,4326))::json As geometry, \n" +
"(\n"+
"select row_to_json(t) \n" +
"from (select comune) t \n"+
")\n" +
"As properties \n" +
"FROM springgis As lg WHERE id >= 0 ) As f ) As fc LIMIT 10");
but it gives me this error:
line 1:23: unexpected token: ":"
have you some suggestion to give me? or some other way..
lang-sql