Thursday 29 December 2016

openlayers 2 - Understanding web mapping tools



Before I start, this is going to be a general question but with specific cases. I've been trying to understand GIS tools and applications to achieve the following:



  1. Build my own basemap

  2. Publish the basemap online

  3. Add my own data layers to the online basemap

  4. Perform analysis (on-the-fly)

  5. Add interactivity to the map



So, In my first attempt, I built a spatially enabled database on PostGIS, queried this using PHP, overlayed it on google maps using their API and added interactivity using their api itself. I carried out analysis like area, denisty etc. on the fly using postGIS functions.


For my next attempt, I downloaded TileMill and rendered some really beautiful maps and added zoom level functions to it. I also exported my MBtile files. When I came across trying to publish this online, I hit quite a few names, but got lost and confused:



  1. TileStache

  2. TileCache

  3. TileStream

  4. Mapserver

  5. Mapnik

  6. GeoServer

  7. Mapbox



So, I understand these are mapservers. But what exactly does a mapserver do? Why is it used? Why can't i server my tiles from a normal web Apache server? And for MBtiles, how many servers are out there which lets you publish it directly?


I can also export my basemap as a png/vsvg format. Can these formats be used to make a basemap through a mapserver?


When researching interactivity I came across:



  1. Leaflet

  2. ModestMaps

  3. OpenLayers

  4. Mapstraction



I understand these are Javascript Mapping API's. But on what base map can I use these? Can it be used on Google maps? Can I use them on my own base maps too?


I basically want to understand the differences between these tools and which would be the best software stack to build a fully customized, interactive map with my own basemap.


Sorry if my question sounds to general. I will definitely be here to clarify my questions



Answer



As you go deeper and deeper into the world of GIS, you'll realize that a lot of work has been already been done to solve common problems.




  1. You have your geographic data in your database. How do you arrange the various layers and render them, and add various map elements to produce a Map that you can print? You need a desktop GIS apllication. You could use one of the FOSS like QGIS, Grass, uDIG ect or a commercial option like ArcGIS desktop etc.





  2. You have geographic data in your database and want to use that to create to a map in your website dynamical. Use a mapserver to read the geo-data and create an image (rendered according to your requirements) for you on the fly that you can show to your users. There are many options for you like Geoserver, Mapserver, ArcGIS Server.




  3. Now you want an interactive slippy map on your website, and using a mapserver to come up with those images in real time is just slow. that's when you use a tiling software to precompute the tiles and serve them. This tiling software can be a mapserver in itself, or something that works with your mapserver, or could be built in the mapserver itself. When you read about TileMill, or TileStream or cached Map services from ArcGIS server, they are used for this purpose




  4. When you were creating the slippy map, how do you handle the various useractions, and calls to the server? Things like zooming in on double click, or calling for new tiles on panning the map, to showing the coordinates on mouseover, as well as stacking images/map/services from different servers/service? You use a client side mapping library like OpenLayers, Leaflet, ArcGIS server's Javascript API and so on.




So to conclude, these different softwares are there to fulfill different needs and solve different problems. You usually need more than one software and usually work with a stack of them, to make something easy and simple looking slippy map on a webpage.



No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...