1

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..

asked May 3, 2016 at 20:52

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.