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 have a layer published on geoserver based on a connection to a postgres/postgis Table and i need to add another table existing on sql server to do a data jointure table to table in order to add external data to my layer..

is there any way to do it?

tnks in advance to your Help.

share|improve this question
    
Did I understand this correcty? You want to join a table stored in MS SQL Server with table in PostgreSQL? –  Shaunak Jun 10 '13 at 13:36
    
yes in fact i would like to use informations stored in sql server for labeling my layer hows comming throught postgres so to do that i need to join two tables .. –  Аюб ибн Ясин Jun 10 '13 at 13:42
1  
What you are asking is not possible on database levels ofcourse and as far as I know GeoServer doesn't support this out of the box. That being said i can think of several ways to get data from different databases to show up on a single map. Could you please elaborate a little more on your front end? and how you are rendering this map? Are you using OpenLayers? What kind of layer is it that you want to label? a Point layer? I think this is more of a architecture problem than one that can be solved using something out of the box. –  Shaunak Jun 10 '13 at 13:49
    
i use openlayers to comsume WMS layers. this layers are published from postgres/postgis but there associated data are stored in sql server and there is common columns between both tables to relate them, so to enrich my map i would like to add labels to my layers coming throught data from sql server (using SLDs of course) tnks :) –  Аюб ибн Ясин Jun 10 '13 at 14:07
add comment

1 Answer 1

up vote 1 down vote accepted

Based on your explanation , here is one way I can think of that should be simplest in your setup. You have Geoserver configured to publish your tables in postgres. Do the same with sqlserver tables. So now you have two separate layers published in Geoserver. Now because you havent mentioned what kind of geometry your data is, I will assume for example the data in postgres is Points. Now instead showing them on map using WMS, you can use the GeoJSON end point that geoserver offers to render these points. You can use the GeoJSON end point from your sqlserver layer too in JavaScript to use your foreign key and label the points in OpenLayers using it. Now things get a little complicated if your geometry is Polygons. but then too you can use same approach and use SLDs on client side to achive desired styling once you have made data association in JavaScript.

share|improve this answer
add comment

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.