Custom Map draw with MongoDB - mongodb

Can anybody say, how can I draw custom MAP vector map (dynamic) with using mongodb's Geo-spatial data?
Or I look for Map maker with using mongoDB.
Thanks.

MongoDB's default data storage is now GeoJSON, see the GeoJSON docs. This format, being an extension of JSON, naturally plays very well with Javascript. There are direct GeoJSON loaders in Google Maps, OpenLayers and in Leaflet, three of the better known Javascript mapping libraries out there. Both OpenLayers and Leaflet are open source, so you can view the source to see how it works and extend as you wish.
You will have to write something to transmit the GeoJSON from MongoDB to the client and you might have to deal with cross domain issues, depending on your setup, see JSON: How do I make cross-domain JSON call for possible solutions.

Related

Is there a way to use own custom data for traffic using the map?

Is there a way to use own custom data for traffic using the gmap, mapbox, leaflet. I just want to show custom data set for traffic using the map like google map indicating traffic in different colors in lanes. I just want to show the same but using own custom traffic data.
Any help would be appreciated.
there is no any Leaflet API to show traffic but you can applies traffic flow data to the map tiles before serving them by using Mapbox to draw on a Leaflet map to represent traffic.Here is the best approach that is not be using Leaflet functionality at all.
A web mapping library allows you to add a map to a web page and define the data it contains, its appearance, and a variety of functionality. Think of it like a toolbox filled with many different map-making tools that can be used together to build beautiful and interactive custom experiences.

Mapbox GL JS Geocoding to only reference Tileset

I'm using Mapbox's Geocoding (search box) and was wondering if there's a way that it would only reference my Tileset data rather than the generic global address search? Looks like Mapbox has a "Supplement geocoding search results from another data source", however the example is referencing geographic coordinates rather than addressing. So I'm still not sure if this is possible?
Basically I want to enter an address in the Geocoding search box and to have a particular polygon selected from my dataset on the map. Any help would be greatly appreciated.
The example you linked to shows how to supplement search results with a local source, not a remote source in the https://github.com/mapbox/mapbox-gl-geocoder.
Currently Mapbox doesn't provide a Geocoding API against your own data however depending on how large your dataset is (and assuming it's a Mapbox Dataset and not just a Mapbox Tileset) you could use the Datasets API to read in every feature into the client with https://github.com/mapbox/mapbox-sdk-js/blob/master/API.md#listfeatures and use the results of that to power the mapbox-gl-geocoder search like https://www.mapbox.com/mapbox-gl-js/example/mapbox-gl-geocoder-local-geocoder/

Use OSM for routing in GeoServer (The best practise)

I am new in OSM but now I need create application which will use GIS (Geoserver) and will be provide service to get road from point A to point B.
I found some informations about this but I still have any questions.
My is download open street maps and extract to database (PostgreSQL), and for routing use plugin pgRouting. Next connect db to map server and provide api for clients.
Questions:
1. Is that correct way?
2. How osm format could I use for postgre? (osm.pbf? shp.zip?, or something else?)
Thanks for answers
Let me elaborate, what things needed to start till end:
First you need to download, OSM data, for which you can simply use Overpass API.
OSM2PO JAVA based CLI tool to convert OSM data into routable data, here is the good guidline how to use this tool.
Postgresql with postgis and pgRouting extensions, you will use dijkstra algorithm to get shortest route, or any other algorithm that best suits you.
Finally you will need Geoserver, that will provide OGC standards e.g. WMS and WFS, through which you can get your route in raster or vector format, you can store your table as layers and you may need a SQL View.
Further, for front end you can use OpenLayers, which is a JavaScript Web Mapping Library or you can use Leaflet,
You can easily do WMS and WFS requests from these libraries to Geoserver and Geoserver will send you a response, with your requested data, if request is correct.
NOTE: You can use QGIS v2 with pgRouting plugin for testing.

Map rendering using OpenStreetMap

Does OpenStreetMap just provide GIS data? To render maps and have a browser based UI to show maps with data, would a developer need to use something like Mapnik?
OpenStreetMap provides data yes, and you'll need specific tools to make map with them. You first need to put the data in a true GIS format, which OSM is not. Think about PostGIS, an osm2pgsql tool is designed for that. Then, you'll need a rendering tool, i.e. a cartographic engine. You can use Mapnik or MapServer. Tilemill or Kosmtik can help you designing your map styles.
Take a look here.
yo can export data form OpenStreetMap and render your own map.
Take a look at
http://www.slideshare.net/jones139/rendering-openstreetmap-data-using-mapnik
http://www.slideshare.net/artemp/mapnik-sotm-2007
There's a fuller list of rendering libraries for OpenStreetMap data here, both free and commercial.
http://wiki.openstreetmap.org/wiki/Renderer
Disclosure: I am the developer of one of them.
OpenStreetMap provides map data out to a wide sprawling ecosystem of different downloads and tools offering developers different map-making and map using possibilities. Here is a diagram I drew which captures some of this:
So the data comes out of the core of OpenStreetMap, in the form of 'planet downloads', one big unwieldy blob of XML (and diffs), but from there it fans out into a range of other offerings to developers, many of which are provided by 3rd parties. Taken together "OpenStreetMap & Friends" provide lots of possibilities.
If you are inclined to run your own rendering system, then yes, Mapnik is a good choice. Powerful and scaleable (most successful OSM tile servers run Mapnik), but takes a bit of setting up. You normally load OSM XML data into PostGIS, and run mapnik from that (tutorials on switch2osm.org)
If you are not inclined to run your own rendering system (for more lightweight web development tasks this seams reasonable!) you don't have to! You can configure LeafletJS or OpenLayers or others to fetch map tiles from a tile server run by somebody else. There are many providers. See the providers list on switch2osm.org and the Tile Servers list.

using external maps with bing map

can i use bing map platform with an external mapping source ?
for example, i want to use bing map siverlight client with my own map files instead of the provided maps. (some areas coverage is insufficiant with bings provided mapping)
Thanks.
Another useful tool you may want to utilize if you don't have ArcGIS Server is MapCruncher, which will take a raster image, allow you to georeference it and produce Virtual Earth compatible tiles.
If you need to display vector data, you can either convert it to a format like KML or use a product called SharpMap to render tiled images.
I am assuming that since this was tagged ESRI, that you want a method to use ESRI products for your data sources... There are a lot of ways you can create your own tiles and use them in Bing Maps. If you have ESRI ArcGIS Server, you can use the ESRI JS API to add your own services to Bing Maps.
you can rewrite TileSource class and override GetUri method