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'm starting to get a better understanding of map-servers in general, but I am still unclear on how best to use GeoServer. At the moment, I use web-hosting to store the web-browser related parts of my site, and php code to connect to a postgresql/postgis database. All of my data is stored in a desktop server, which I chose to use as it is a very low cost way of storing a large amount of data.

1] web-browser <--> database   

This works fine also, as I do not need to style vector data; I am only returning numerical results with geojson vector overlays. However, I would like to incorporate GeoServer into this workflow so that I can apply better cartographic styles to data in the future. I understand the work flow should be similar to the following:

2] web-browser <-->  GeoServer <--> database

My difficulty in understanding this piece, is how to connect GeoServer into the process. Can I run GeoServer on my desktop and connect to it to the browser via php, similar to the database approach? Or does GeoServer need to be installed on the web-host and managed there?

share|improve this question

2 Answers 2

"However, I would like to incorporate GeoServer into this workflow so that I can style data in the future."

If you mean modifying/editing geometry WFS-T is a good option indeed. But if you mean just changing the style of the map (so different colors for the values of attributes etc) you should focus on SLD.

In any case you will need a Geoserver pointing at your database like you explained.

However for accessing data I would not use Geoserver (particularly REST API) since (as far as) I understood you already have a mechanism to achieve that (why not just keep using it?). Apart from that you have the total control over your environment and interoperability does not seem to be an issue for you.

share|improve this answer
    
To clarify, I want to be apply to apply nice cartographic styles to more complex vector data; and am trying to figure out if geoserver can sit on my web-host, or beside my database on my own desktop server. –  djq Jun 5 '12 at 11:37
    
In terms of cartographic styles if you are going to use Geoserver as a WMS (Web Map Service) you'd better look at SLD (Styled Layer Descriptors) specification. There is a nice cookbook : docs.geoserver.org/latest/en/user/styling/sld-cookbook/… On the other hand if you will use openlayers and display vectors than you probably will not need Geoserver you can style vectors in client side... About web-host vs desktop server; it is all up to you and both possible I believe but I would run Geoserver next to database (as close as possible) to avoid performance penalties... –  oalan Jun 5 '12 at 18:46

you can of course install it to your desktop but the best is that installing it another machine for not to slowing down you when you are working.

what am i understand from your second question is that you want CRUD (Create, Read, Update and Delete ) operation via php. to this you can check out REST Api here which will let you do this operation.

For all these processes you can use PHP/cURL function. More information is here.

PHP has cURL functions , as well as XML functions , making it a convenient method for performing batch processing through the Geoserver REST interface.

enter image description here

Setting up GeoServer, there are lots of document in internet. one of these is here and check out this example OpenLayers WFS-T Using a GeoServer Hosted PostGIS Layer too.

The WFS-T protocol was designed for that exact reason, as it allows for ‘transactions’ to occur. A WFS-Transaction can be used to add, remove or modify the features that are loaded, and most importantly allows for the changes to be committed back and saved to the parent source. For this reason it is important to have your data which you wish to modify to be stored within a spatial database such as PostgreSQL/PostGIS so that the transactions can be managed properly.

i hope it helps you...

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.