gis tool capabilities on linux - gis

Currently I have an openlayers web page which querys a tilelite server serving up mapnik tiles with various shapefiles (rivers, lakes, fire boundaries, time zones, nat forests, BLM land, tv reception contours ...) added through layers-shapefiles.xml.inc.
Soon I will be traveling extensively around the western US. I'm looking for a system that can generate tiles locally so I don't use up my data usage (my current setup works well for this), but has a little more capability when it comes to querying shapefile data. My current setup is pretty limited when it comes to this. I can turn on and off shapes and names depending on the zoom level but I'm looking for something that might let me query individual shapes and present the cooresponding data (from the shapefile db) in say a popup window or slide out frame. I'm OK with constructing the popup or slideout frame if needed.
I'm thinking of installing mapserver and seeing what it can do, and I will probably do that today, but I just thought I would ask if anyone might help steer me toward a tool with the capabilities I'm looking for.
Update:
I've taken a day to familiarize myself with mapserver. I can turn on and off layers, which I couldn't do with mapnik tiles served up by tilelite and screened by openlayers. However, I couldn't find any examples of people doing what I previously described which was querying an individual shape and getting the attributes for that shape from the shapefile attribute table and presenting it somehow on the web page via balloon, popout... Is what I'm asking possible yet?

Thats possibl. Check here
http://openlayers.org/dev/examples/getfeatureinfo-control.html
http://demo.mapserver.org/tutorial/section3.html

Related

What would be the best Web Mapping API for the following requirements?

I have a fairly simple, and what I would think to be common mapping web mapping project to complete. I'm struggling in my selection of a web mapping API. Thus far, I've not been able to one that meets the following requirements.
Able to display thousands of points in one view without choking crippling the browser. To be specific, I'd say I would like to display roughly 30,000 points at one time and still be able to navigate around a slippy map without degraded performance.
Local maps. The web server will run on the local client, so being able to display a map without reaching out to the internet (even if it's a very basic map) is an absolute requirement.
Render dynamic data from a database onto a map (most API's are meeting this requirement).
Draw polygons directly on the map, and export the lat/lon values of all vertices.
In your experience working with map api's, do any of them meet the requirements above?
I've looked at OpenLayers 3, Leaflet, and Polymaps. Aside from reading every piece of documentation ahead of time, I can't discern if any of these would fill all requirements. Again, I'm hoping someone with experience with any API could point me in the right direction.
Thanks!
As for Leaflet:
Thousands of points: you could use one of these plugins:
Leaflet.markercluster, clusters your points into "groups of points" at low zoom levels.
Leaflet MaskCanvas, replaces all your points by a single canvas layer.
Local maps: as long as you provide a way to create image tiles (even on the local machine), most mapping libraries should work.
Dynamic data: depending on what you call "dynamic", all mapping libraries should provide you with built-in methods to display your data.
Drawing polygons and export lat/lon vertices: use Leaflet.draw plugin
OpenLayers 3 would very probably provide you with all these functionalities as well.

Speeding up a very large Bing Maps polyline based layer

I am writing a Bing Map based Universal App for Windows Phone and Windows 8 that shows some quite large map layers.
Writing the initial app was no problem (the tutorial I followed is at http://blogs.msdn.com/b/rbrundritt/archive/2014/06/24/how-to-make-use-of-maps-in-universal-apps.aspx), however I now am experiencing major problems rendering a layer that contains thousands of polylines, with tens of thousands of co-ordinates.
The data is just too big - on Windows 8.1, the map crashes the application, while on Windows Phone 8.1, the layer takes a very long time to render.
According to http://blogs.msdn.com/b/bingdevcenter/archive/2014/04/23/visualize-large-complex-data-with-local-tile-layers-in-bing-maps-windows-store-apps-c.aspx, I should speed it up by converting it to a local tile layer, however, the program mentioned in the article (MapCruncher) requires a PNG as input. The question is, how do I convert my map data to a PNG? I can have the data as a shapefile, KML file, or a CSV file. Is there another way I should be doing this? I know I can do this via Geoserver, however my app has to have offline support and so cannot download from the web server the appropriate files as needed.
If anyone has an other ways I could approach this speed issue with large layers, then that would be greatly appreciated. I am aware that I can speed up rendering of a layer in Bing Maps via quadtrees, however most of what I have found is theoretical. If anyone has some code I can plug in to this, that would be very helpful.
Local tile layers are fine if you only have data in a small area, or only want to show the data for a few zoom levels. Otherwise the number of tiles grows drastically and will make your app huge. If your data changes regularly, or you want to support all zoom levels of the map you should store your data on a server and expose it as a dynamic tile layer. A dynamic tile layer is a web service that generates a till on demand from your data. You can add caching to the tiles for performance. This is the best way to handle large data sets and one I have used a lot. In fact I have a demo here: http://onsbingmapsdemo.cloudapp.net/ This data set consists of 175,000 complex polygons that equates to about 2GB of data.
I have an old blog post on how to do this here: http://rbrundritt.wordpress.com/2009/11/26/dynamic-tile-layers-in-the-bing-maps-silverlight-control/
If you prefer working with MVC you might find these project useful:
https://ajaxmapdataconnector.codeplex.com/
https://dataconnector.codeplex.com/

Poor rendering time when plotting large shape files on Google Maps

First, I'd like to let it be known that this is my first journey into developing mapping applications with such a large set of data. So, I am in way locked into the techniques or technologies listed below...
The Overview
What I am trying to accomplish is the ability to load my company's market information for the United States onto some form of web-based mapping software. Currently I am trying to accomplish this with Google Maps JS api and GeoJSON data, but am not against other alternatives. There are roughly 163 files (ranging from 6MB to 200KB) that I have exported from ArcGIS into GeoJSON files, and then loaded into a database (currently as GeoJSON strings). We have developed a UI that loads the data based on the current map bounds and Max/Min calculations in the corresponding records.
The problem I'm running into is the render time on the map itself, which is annoying when switching between different regions, states, or zoom levels. The API calls to load the data are acceptable in regards to the size of the data being retrieved. My boss said it is great for a proof of concept, but would like to see it much, much faster.
The Questions
What suggestions could you offer to increase the render time?
Are there better options (3rd party libs, techniques, etc) for what I'm trying to accomplish?
It was suggested by a co-worker to export the map shapes and just use the images for overlaying the information based on the coords. Any input on this?
One solution to your problem could be reducing number of vertices in polygon or polyline layers (files) while preserving feature's shape. In that way geoJSON file would be smaller and easier to render.
You can use tools available in ArcGIS for Desktop.
See
How to Simplify Line or Polygon
or
Simplify Polygon
I'm sure there are similar tools in QGIS or any other open source GIS software.
There are other solutions to your problem like prerendering data in map tiles that could be overlayed over Google Maps basemap(s). That is probably the fastest solution but more complicated.
Maybe this could be good starting point.
Just couple of random thoughts.
On one project I worked on I noticed terrible performance with geoJson I loaded via REST service.
I found out that browser's JavaScript engine had hard time parsing large geoJson responses. I finally decided to load data in batches (multiple requests). Performance increased enormously.
I noticed you use 163 files (layers?). Do you display them at the same time (no no no) or you have some control panel to switch layers on/off? If you display them at the same time then performance will suffer for sure and you should look into generating map tiles with thematically grouped layers. In that way you'd come up with couple of tile layers that you can switch on and off.
Also, if data used to generate tiles changes frequently than tiles aren't good idea. Then maybe you should look into Web Map Services. WMS generates maps on the fly from data stored in database. GeoServer supports WMS and it's easy to configure and use.

I need to make a clean, nice-looking map for a presentation based on a Google map. Any easy way to do this?

I want to make a very clean map that only shows relevant information - e.g., only the streets that matter. I was going to just draw a map while looking at Google's, but that turned out to be very slow. Is there any way to make this easier, perhaps with some combination of mapping software and Google's API?
(If I should of put this on another SE site, please tell me)
Building upon Suvi's nice answer.
There is a very useful open-source project that collects street data for the entire globe. It's called OpenStreetMap. On their website you can extract the specific street data you need. It only takes a few clicks and bam! you got the map you need. Their data can also be accessed (perphaps easier for some) from here and here. Those links can provide you with the shapefile(map) that you need. Your newly aquired map can then be loaded in the free QGIS software that was mentioned. There you can easily select the streets you are interested in.
When you mean you want to only show "streets that matter", you are out of luck with using Google Maps. Because you have no control over the ROADMAP data that google provides. Now what you can do, is use another mapping software such as ArcGIS or Quantum GIS (which is free). Both these softwares allow you to load road data shapefiles, and you can query (select) which roads you want to display and customize the look of it to your liking.
If you want a quick approach (without having to download softwares), I believe ArcGIS has an online portal which allows you to display information you want on top of their base maps. You will still need the shapefile for your streets though. Check this link out, make yourself an account and experiment around with it http://www.arcgis.com/home/. If you click on the Map tab, it takes you to a screen which should allow you to upload shapefiles.
You said you were ' going to just draw a map'. If all you need is a very clean map, you can consider using iMap Builder which is a mapping software supports both map shape files, and custom Google maps. I have used to create some simple map projects before and worked great for me. You can use their pre-made map templates which shows just the map outlines without any details, you can then add routes / points / mouse-over speech bubbles etc as you need.

Plot hundreds if not thousands of addresses and do a radius search

In my web application I have a list of businesses/clients and their information, including their address. I'd like to mark one of them, then get the other businesses/clients that are in a X km radius.
I'd prefer to control the X with a slider, and I'd prefer to display the results on a map as well, but neither point is crucial. How should I go about this? Would Google Maps be a good tool? Where can I find more information, or an example of this?
Google Maps API should work well for this.
In fact combine it with Fusion tables, is even better. FT will host your database, and make making 'spatial' queries against your data easy (ie results within X of Y). FT is even intergrated with the Maps API to display the results of your query direct on the map.
If you want to use an Open Source Javascript library with possibly a bit more flexibility than google maps' API, use OpenLayers - and if you dont want to have to pay the new Google Maps API fees, you can use OpenStreetMap for your background layers. Make your slider with something like jQuery UI or Dojo and link them with some event handling. Job done.
What's your back end application written in? There's assorted geospatial libraries that make spatial queries nice n easy in most languages. A bit of googling should bring them up. I doubt you'll need to go for a full spatial database, but if you do then check out PostGIS - that can do stuff like find all the businesses within Xkm of a major road (once you've got all the data into it of course!).
www.osgeo.org is the best start for open source geospatial software. Lots of web, database, and desktop tools there.
Google Maps doesn't support a local search. It provide only an API to find and set marker and get a direction. It has some beautiful maps, too. What you want is the harvesine formula to look for close targets. Alernatively you can use a spatial extension and search for tiles or cluster of targets. It's just an approximation. I don't thin that FT support the former or the latter. It's just a Sqlite-alike database to store your markers.
Try mysql spatial extensions.If you cannot implement Radius Query which i think you cannot consider strongly to switch to postgresql+postgis.Once you migrate this problem will be solved in 5 minutes.
Also for a custom solution take a look at this answer
Cheers