0

I need to connect to a MySql table, which has all the attribute values and the lat & long. I am using a GeoServer Suite to host my raster and so felt the best way to go about it would be to add the MySQL to my Geoserver, but it seems, geoserver comes with Postgres by default.

Is there any My SQL extension to geoserver?

Is this the best approach to obtain the info from a MySql database?

UPDATE: Ok so what I am trying to do is eventually migrate my Database to PostGIS. So I am trying to create a shapefile from MySQL database. The database has non-spatial data with the lat and long associated with each attribute data. I found pyshp, but i think that is reading the shape file. Can we create shapefile using the pyshp (meaning can we create shapefile from MySQL database using pyshp)? Becoz if i am able to create the shapefile then I can easily insert it into PostGIS using geoServer and it can be used in other softwares as well.

2
  • I know that your raster is hosted using GeoServer, but what format is it stored in? For example if the raster is in a database also, then it might be easier to create a query joining the raster and your MySQL tables together first, and then using GeoServer to host the results of that query, rather than trying to do this join after the fact. May 5, 2012 at 0:15
  • Yes the raster is in GeoTIFF format. I wish to do what u r saying but how can I join the raster to a MySQL table, since the info in the raster is being extracted using the struct function. How can I find out or access the attribute table of raster?
    – Sam007
    May 5, 2012 at 18:23

1 Answer 1

2

first of all pls. make acception for accept rate. :)

You can connect mysql to geoserver from Create New Feature Data Set

1.Select New from Config -> Data -> DataStores and define your Feature Data Set Description to MySQL and your feature dataset

2.On feature data set editor, write your database name, user and password with host and port. alternatively you can define maximum and minumum connections.

3.And the last think is submitting and saving your options.

it will come soon is that defining FeatureType. i want to write everything here about connection between geoserver and mysql but i have checked there is good information on opengeo which is very good that you can read on Adding a MySQL Table to GeoServer tutorial...

i hope it helps you...

3
  • ok when I said connect to MySql table, it is a table with attributes. It is not a spatial data. I think the tutorial is if i wish to connect to a spatial data. Will it work for non-spatial content?
    – Sam007
    May 4, 2012 at 18:06
  • 1
    There is a ticket here "it is for arcsde" Allow serving non-Spatial data. Pls try patches, if not you can open a ticket for your error
    – urcm
    May 4, 2012 at 19:21
  • 1
    how do I install the patch?
    – Sam007
    May 4, 2012 at 23:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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