Anyone know how to integrate WMS map data into a web app? - google-maps

I want to build a web app that uses map data provided by a WMS server. I want to load that data into a database then display filtered data on a live map.
I'm a beginner programmer and I haven't been able to find much info on how to implement this online. I work with WMS alot in GIS software but don't know what goes on behind the scenes. For the website map I plan to use google maps API or mapbox.

A Web Mapping Service (WMS) serves rendered map images, not the data underlying the rendered map image. You could cache these images if you want, but it is not at all trivial to extract vector features from them, and in most cases attempting to do so would violate the terms of service of the WMS.
Instead you might try looking for a WFS (Web Feature Service), which serves vector features. Again be wary of terms of service.

One approach to doing this would be to use a map server that supports WMS for the delivery and a database (or, e.g., GeoTIFF format files) for storage of the data being served. GeoServer is one such map server that can be used to accomplish that, using their WMS capabilities. If you have WMS services you are already familiar with you can use GeoServer to proxy acccess to those existing services as a way to get started. I did this using OpenLayers to render WMS layers on top of Google Maps base layers when I was getting started with WMS.

Related

How to implement a (variable!) map into website

i would implement a Map on my Homepage.
It should display a route from a fix start point to a variable end point.
We have a database (mysql) which contain adresses (Street and number).
And thats the only way to determine the two points
I have completely no idea how to do that.
is OSM (OpenStreetMap) a good way to do that? But how can i get coordinates from a adress ...
Yes, OpenStreetMap is one possible way of solving your task.
To embed a map based on OSM you should either stick to Leaflet or OpenLayers. Both offer slightly different features but are easy to use. And both can easily display a GPX file (your route) as an overlay on top of the map.
For calculating this route you can choose from one of the many online routers, offline routers or just stick to a library.
Similarly OSM offers a way to convert an address to coordinates. This is called geocoding and can be done using Nominatim.
Remember to check the usage policies if you decide to use any of the web services (routing, geocoding, tiles). For most of these services there are alternative instances available which are run by different companies and have less-strict usage policies. And of course you can also run your local instances of most of these services if you like.

Openstreetmap Data with OpenLayers vs google maps?

I am trying to use a map provider. I wanted to know which of these is better.
Until now, all the reading I have done indicates OSM data is better. Mainly for, It's OPEN & off-line usability. But couldn't get a proper take on which Layer to use.
How are the API supports?
Which tiles to use? (mapnik used by openstreetmaps seems to be nice & free)
OpenStreetMaps Tile usage policy(http://wiki.openstreetmap.org/wiki/Tile_usage_policy) does say limited usage.
Which other slippy map layers are good/better with openstreetmaps (free/paid).
My requirements are:
To allow users to query for routes.
To allow users to look for a location based on GPS co-ordinates.
Add a layer to display a set of some of my data based on location.
OpenSteetMap data is better in the sense that:
It's free and open.
the data is being provided by thousands of users and it's more precise and covers much more information than Google maps data. (except for the satellite view which doesn't exist in OSM).
Tiles - depends on the application you would like to build. For a small (not a high number of http requests) web application you can use the web API which is highly documented and reliable.
The real advantage of OpeenStreetMap, is using OSM data and a number of tools to built you're own OSM server (a good article here), and to use Mapnik or Osmarender tiles render engines for generating you're own tiles that can be used on web applications.
This is why the Tile limitation usage exists, because they recommend hosting and using your own server tiles.
The main difference between Mapnik and Osmrender is that the second exports SVG tiles format.
Information regarding your requirements:
A. routing
It's possible to use OSM data to build a routing web application.
Here is a list of routing programs and web services on OpenStreetMap wiki
Here are two websites using routing with OpenStreetMap which can give you an idea of how it's used on web applications:
yournavigation.org
openrouteservice.org
B. search by gps coordinates
You can use reverse-geocoding and query the OSM database for GPS coordinates the Nominatim tool.
Here is a web application using this tool.
C. layers
Here is the list of webmaps libraries that you can use.
OpenLayers can work with Mapnik generated tiles and it's a commonly used library (with no server-side dependencies) with plenty of docs. It's a framework that can be used as well with Google maps, so it's worth giving it a try.
Polymaps integrates well with SVG tiles generated be Osmarender. It can generate display / diagrams / of specific areas based on marker - user location.

Google maps Javascript API vs. KML layer?

Is there any general advice when to use KML layers or the Javascript API? There are several needs for the app. I need to display markers for moving object on the map. These will be refreshed every minute in average. But there will be a lot of static markers to be displayed on demand. These are just markers. But in another screen I need to draw the driven routes.
Actually I'm not sure what's the best way of displaying all the needed data. KML? Only get the data and to the rest by the API on the fly? Generate the code on the server and just upload it to the browser. What would be the best in terms of performance and and easy usage for the developer?
I think javascript layers are faster than kml.
(The fastest speed is to generate image tiles - but that takes a lot of time and needs to be done statically).
I'd use AJAX to generate the data on the server and send it to the API on the fly.
I think KML is useful if you want to share the data with other websites and people using desktop GIS software. It is extremely easy to use someone else's KML layer. It is much harder to use their javascript array.

How to create own maps using own database

I want to make map of a particular region, just for education purpose.
I have gone through several web site , which tell to make maps.
like
http://worldwind.arc.nasa.gov/java/demos/,
But i did't find the way as GOOGLE/BING/YAHOO show their maps like its graphics quality and all that its features.
i need to add features in the map like "adding a tag, show distance", as google show.
I would also like to connect it to database(My own).
I don't want to use google api, because i can't connect it with my own data base.
I went through this before for me it was a 4 tiers application:
Database, I used Sql Server 2008 Spatial Database.
Map Manager application, its main objective is to import the spatial data from different sources into the sql database, and other minor objectives like (styling the map objects, edit visible zoom level of objects, ...)
WMS, a RESTful wcf service that renders the tiles.
Map Client Control, a silverlight control that renders the tiles from the WMS.
You can find a lot of resources on the web on how to manipulate the spatial data (read, write, search...) and for rendering tiles I used the Bing Maps Tile System
http://msdn.microsoft.com/en-us/library/bb259689.aspx
And what remains is just the implementation,
The Map Client Control requests a tile from the WMS.
The WMS calculates the tile boundaries and retrieves the spatial data within these boundaries and render them on an image and returns it to the client.
The Map Client Control is responsible for layouting the tiles, zooming, panning...
You can cache the rendered tiles by implementing some cache techniques.
And finally I wish you good luck.

Creating custom Google (or OpenLayers?) maps

I'm currently working on a project which maps items to a physical location within a building. We have a map created in our GIS system (ArcGIS), and are able to resolve items to the appropriate shape ID on this map.
We want to create a web map using one of the APIs such as Google maps or Open Layers in order to display this info, directing the user to the correct location on the map, and ideally highlighting the particular location (for example using a shaded polygon), or at least identifying it with some sort of marker.
However we're very new to all of the online mapping APIs, and are finding it pretty overwhelming at the moment. All we really want is a flat map with our own custom imagery - we dont really care about geo-referencing, or projections etc.
Does anyone have any tips or info about how we might go about this? Even just general pointers would be helpful - it's hard to know where to look when there's so much info out there!
Cheers
If you are using ArcGIS Server, use ArcCatalog to expose your data as a WMS.
If you do not have an ArcGIS Server license, you can use MapServer or GeoServer to do the same (i.e expose as a WMS).
OpenLayers has support for adding WMS layers. See their examples section for sample code.
Cheers
OpenLayers can handle your own custom imagery maps without any problems.
You can check out this example:
http://openlayers.org/dev/examples/image-layer.html
And of course you need to read the API documentation
If you are using ArcGIS to creat eyour map, then use ArcGIS Server to serve up the maps online. Then use ArcGIS JavaScript API to build your web application. There are several out-of-the-box templates as well as easy-to-use examples for performing basic actions such as pan, zoom, select, highlight, redlining, etc.
Create your map service, then add your custom Map as a Dynamic Map Service or a Tiled Map Service (if you've cached it). Perform a Find (or Query if you have more than one feature you want to highlight). Add the Graphic from the FindResult to your GraphicsLayer.
Here's a more complete example.
You could also look at MapGuide OS and (if you don't have studio) Maestro. It is a server side application that will take in SHP files from Arc easily. The only downside IMO is that the built in search and reporting functionality is rather limited but can be extended via the API (C#, PHP and Java) that and it is rather centralized with a persistent process on the server (which can make debugging exceedingly fun).
The fusion/flexible (or whatever they heck they call it) layouts are based on the OpenLayers API but is still relatively new. And you can publish as a WMS or WFS I believe (I haven't done it personally).
If using ArcGIS Server, you can also expose your imagery and feature layers via a REST endpoint that can be consumed by OpenLayers. Check out James Fee's blog post on the topic.