[OpenLayers-Users] How to display PostGIS data through
Openlayers and JSP
Cédric MOULLET
cedric.moullet at gmail.com
Sun Jul 25 05:29:49 EDT 2010
Hi,
There is for sure not only one answer to your general questions, so let me
try to provide one possible answer for them.
Cédric
On Sat, Jul 24, 2010 at 10:49 PM, George Matt <georgematt99 at yahoo.co.uk>wrote:
> Thanks, Steve for your reply.
>
> Ok if your are talking about a mapping server, than lets put it this way.
> I have installed and configured GeoServer and using the postgis option
> available in it, the layers are published. Now using WMS or WFS
> services, layers are requested and shown on the map.
>
> Some question arises:
>
> (1) What is the benefit of using PostGIS then? Where the use of postgis can
> benefit me? These layers can be easily published in the same way through
> shape files and shown on the map. OR may be I misunderstood it.
>
>
Quite obvious, but with a database, you have the possibility to use SQL
(spatial SQL for PostGis).
For data extraction, WMS or WFS are not very performant. Several web mapping
applications are using REST services. These REST services are quite easy to
implement with a database in back end and can be fine tuned if you use a
database (indexing, spatial indexing)
> (3) About searching: suppose there is a textbox on the page through which
> the user can search and zoom to a specified feature. (Relating to my
> example, suppose user enters the name of a road). How this can be achieved.
> Would the postgis or geoserver sort this problem out?
>
>
In this case, I would implement a search service. Postgres Full Text Search
is very performant. SQL queries can also be used, of course.
> (4) If there are multiple layers (For e.g roads, cities, train stations,
> schools, etc). How can the functionality of searching through a single
> textbox be implemented.
>
>
Which level of performance do you want to reach ? It's clear that searching
in multiple table and in multiple attributes can be quite slow. As solution,
you can store everything in one table (only for search purpose. Materialized
view can be of interest). Or you can multithread the search, but, in this
case, you have probably to take in account the server load.
> (5) How one can perform some spatial analysis and show it on the web? (e.g.
> A user wants to view major roads with in 5km radius reference to his home)
>
>
Again, with a web service using spatial capabilities of the database. WPS
can be of interest in that regard.
> I have seen question/topic related to these issues on the forum, but
> unfortunately no satisfactory answer was given.
>
>
Again, your questions are very general and can be solved in various ways.
The answers depend also of the expected number of users of your web mapping
application, the use cases you want to cover, the expected performance and
ergonomy, the technology context of your company etc, etc.. This explains
also why the OSGEO groups several project (http://www.osgeo.org/) that
partially overlaps.
> What are your suggestions?
>
> Thanks,
> --
> Matt
>
>
> ------------------------------
> *From:* Stephen Woodbridge <woodbri at swoodbridge.com>
> *To:* George Matt <georgematt99 at yahoo.co.uk>
> *Cc:* users at openlayers.org
> *Sent:* Sat, 24 July, 2010 19:19:10
> *Subject:* Re: [OpenLayers-Users] How to display PostGIS data through
> Openlayers and JSP
>
> George Matt wrote:
> > Hi all,
> > Is it possible to show postgis data in openlayers?
> > If yes can some body points me to some links or upload a working example
> to illustrate.
> > A usecase can be:
> > Consider a road table (road_id, geom, road_name) in the postgre/postgis
> database. In SQL the select statement can be [SELECT road_id,
> ST_AsText(road_geom) AS geom, road_name FROM roads;] to select all the
> roads. Now how to give it to openlayers to show them on the map.
>
>
> George,
>
> You need some application on the server side like:
>
> - mapserver that can connect to the database and render a map image. There
> are other application that can do this, some in java if you prefer.
>
> - or you can do the query on the servlet and format the results into GML or
> GeoJSON, but this in only viable if you have under 1000 features that you
> are rendering at any give time. And 1000 might be pushhing the limit
> depending on the browser performance and memory.
>
> -Steve W
>
>
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>
>
--
Welcome to my world: http://www.cedricmoullet.com/
My Linked In profile: http://www.linkedin.com/in/cedricmoullet
Twitter: http://twitter.com/cedricmoullet
Home sweet home:
http://map.geo.admin.ch/?crosshair=bowl&zoom=11&X=185241.24219&Y=561288.90625&bgOpacity=0&selectedNode=node_ch.swisstopo.fixpunkte-lage1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20100725/1089f645/attachment.html
More information about the Users
mailing list