Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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? Thx

share|improve this question

2 Answers 2

up vote 2 down vote accepted

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.

share|improve this answer
    
thanks, work great now, i did a geometry col and load it with the mysql plugin –  Jordan Oct 29 '13 at 18:30

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.