[Geoserver-users] Fundamental Question, db data mapping of coordinates

Hello,
I am trying to set up a basic project which will display small circles at specific locations on the map.
I will use the mySql plugin.

I have two columns in the database, “lat” and “lon” which contain my lat/lon coordinates. They are of type float.
When attempting to create a new featureType how do I express to geoserver that I wish the lat/lon columns to be interpreted as geospatial data?
I understand how in the SLD to create filters based on datastore elements (the population sld is an example), but taking for example the tasmania_cities project, I see no reference to the column “the_geom”.

I don’t get how geoserver knows that “the_geom” is the coordinate data.
I also don’t understand how to appropriately select a SRS when working with simple lat/lon data from a GPS device.

Any help is greatly appreciated.

Thanks,
Lucas

Lucas Vickers wrote:

I have two columns in the database, "lat" and "lon" which contain my lat/lon coordinates. They are of type float.
When attempting to create a new featureType how do I express to geoserver that I wish the lat/lon columns to be interpreted as geospatial data?

Why don't you create a geometry column using something like: "location Point" in your "CREATE TABLE" statement ?

You may then insert data into the location column with the function GeomFromText (i.e. GeomFromText('POINT(31.5 42.2)') ), read more at:
http://howto-use-mysql-spatial-ext.blogspot.com/

I don't get how geoserver knows that "the_geom" is the coordinate data.

It depends on the data source, but you may force an SRS of your choice via the admin UI.

I also don't understand how to appropriately select a SRS when working with simple lat/lon data from a GPS device.

Use EPSG:4326.

Regards,

--------------------
    Luca Morandini
www.lucamorandini.it
--------------------

Luca Morandini wrote:

Lucas Vickers wrote:

I don't get how geoserver knows that "the_geom" is the coordinate data.

It depends on the data source, but you may force an SRS of your choice via the admin UI.

Ahem... this sentence of mine begs for a bit of an explanation: some data sources (DB2 , PostgreSQL, Oracle) record metadata about spatial columns in a table, hence GeoServer knows column names, geometry type, SRS, etc... some other data sources, like MySQL, don't have a spatial metadata table.

Regards,

--------------------
    Luca Morandini
www.lucamorandini.it
--------------------

This makes sense, now I get it.

thanks!

On Mon, Jun 8, 2009 at 3:01 AM, Luca Morandini <lmorandini@anonymised.com> wrote:

Luca Morandini wrote:

Lucas Vickers wrote:

I don’t get how geoserver knows that “the_geom” is the coordinate data.

It depends on the data source, but you may force an SRS of your choice via the
admin UI.

Ahem… this sentence of mine begs for a bit of an explanation: some data sources
(DB2 , PostgreSQL, Oracle) record metadata about spatial columns in a table, hence
GeoServer knows column names, geometry type, SRS, etc… some other data sources,
like MySQL, don’t have a spatial metadata table.

Regards,


Luca Morandini
www.lucamorandini.it


OpenSolaris 2009.06 is a cutting edge operating system for enterprises
looking to deploy the next generation of Solaris that includes the latest
innovations from Sun and the OpenSource community. Download a copy and
enjoy capabilities such as Networking, Storage and Virtualization.
Go to: http://p.sf.net/sfu/opensolaris-get


Geoserver-users mailing list
Geoserver-users@anonymised.comsts.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users