1

I am storing all my features in MySQL db and I am getting them with ajax and adding to the OpenLayers map. Now I have to many features and it's taking a lot of time to get all of them and adding them, so I want to load only little bit from them and show all the rest with GeoServer in a WMS layer. I found some plugins but nothing really worked, and I didn't find any example. The features are stores in the database as a regular table not as spatial data, only have attributes and a col for WKT for the location.

Is there a way to add this features from mysql db to GeoServer layer?

PolyGeo
65.5k29 gold badges115 silver badges350 bronze badges
asked Oct 28, 2013 at 17:33

2 Answers 2

3

You would need to use the MySQL spatial functions to cast your WKT or other attributes(such as float X/Y) to geometry objects, then point geoserver(with mysql plugins installed) to those tables and have geoserver render them.

Something like:

UPDATE myPoints SET the_geom = GeomFromText('POINT(long ,lat)'));

You can refer to this question for a more complete answer for adding a geom column and updating it with whatever geographic information you have now.

answered Oct 28, 2013 at 18:28
0
0

I haven't tried this but if you need to have the geometry stored as WKT for whatever reason as opposed to a real geometry column, you could create a new layer based on a SQL View and create the geometry column on the fly using WKT->Geometry conversion functions.

The catch is the layer is not modifiable.

answered Oct 28, 2013 at 19:01

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.