[Geoserver-devel] Connecting data sources to Geoserver

I am using a postgres database table and see how to the Data/Stores/ and Data/FeatureType web pages of GeoServer admin tool to add data, but its not clear how GeoServer knows which fields of my table are the fields it will use to display on the map. There does not seem to be any selector on the page to allow me to specify which fields are my lat/lon fields. (my data is point data).

Geoserver obtains the spatial information from the geometry columns table of PostGis. It uses that information to determine what columns in your dataset are the spatial columns, it also finds out the projection and dimensions from that table.

Brent Owens
(The Open Planning Project)

Tim Schreiner wrote:

I am using a postgres database table and see how to the Data/Stores/ and Data/FeatureType web pages of GeoServer admin tool to add data, but its not clear how GeoServer knows which fields of my table are the fields it will use to display on the map. There does not seem to be any selector on the page to allow me to specify which fields are my lat/lon fields. (my data is point data).

------------------------------------------------------------------------

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
------------------------------------------------------------------------

_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel
  

Tim Schreiner ha scritto:

I am using a postgres database table and see how to the Data/Stores/ and Data/FeatureType web pages of GeoServer admin tool to add data, but its not clear how GeoServer knows which fields of my table are the fields it will use to display on the map. There does not seem to be any selector on the page to allow me to specify which fields are my lat/lon fields. (my data is point data).

By using "fields" you make me think you've a x and y column for your points, that is, not a geometry, but two flat columns. This is not supported by the Postgis data store, it requires you to have a column
with Geometry type, point in your case. Geometry types are provided
by the Postgis extension.

In your case you can:
* add the column and have your software populate it, and spatially i
   index that column for faster access (best solution
   if you can afford it);
* create a view that builds a point geometry out of your columns
   using postgis functions, and the register the view in the postgis
   geometry_columns table. Not sure you can do it, and you cannot
   add spatial indexes to your view
* add the geometry column on your table, and have a trigger
   populate/update it every time you insert/modify a record, so that
   your software stays unchanged. You'll need a bit of fiddling
   with text functions and postgis geometry function, but I think
   its doable. This also allows you to spatially index the column.

Hope this helps
Cheers
Andrea Aime