[OSGeo Africa] Geoserver SQL View

Admire Nyakudya addloe at gmail.com
Fri Dec 10 10:38:23 PST 2021


Hi

Sent with a Spark
On 10 Dec 2021, 11:17 +0200, Zibusiso Ncube <ncubezedm at gmail.com>, wrote:
> Good Day,
>
> I have a MySQL db instance that I am "replicating" (also a means to clean up my data via python) to a postgres instance.
If your data doesn't have any relations you can use ogr2ogr to migrate it from mysql to Postgresql tables. If it has relations you will need to find a tool that allows you to convert between the two.
> initial i was creating  a points layers using lat and long fields in my db using SQLview using
>
> ST_SETSRID(ST_POINT(point_longitude, point_latitude), 4326) as the_geom I have some data that has 4 coordinate points and these are the corners of ploygons/areas of interest. Is it possible to use SQLviews in Geoserver to create polygons?
>
> Has someone tried this? How best can one do this?
If your question is more about can Geoserver SQL views achieve this then yes it can.
>
> can i use something along the lines off...
>
> ST_SETSRID(ST_POLYGON(point1xy, point2xy...pointZxy), 4326) as the_geom
This sounds more like a question of how to write the SQL to achieve this. The Postgresql documentation has nice examples of this ie
https://postgis.net/docs/ST_MakePolygon.html

 Alternatively you can check some of the answers on stack exchange as they provide solutions to this question i.e  https://stackoverflow.com/questions/19046642/convert-points-to-polygon-using-postgis
> ?Regards
>
> Zibusiso M Ncube
>
> _______________________________________________
> Africa mailing list
> Africa at lists.osgeo.org
> You can UNSUBSCRIBE at https://lists.osgeo.org/mailman/listinfo/africa
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/africa/attachments/20211210/3f6ede03/attachment.html>


More information about the Africa mailing list