I am planning to create a new web application in which i want to use open street map, i need source code of open street map.In my web application i need features of see different shape file on layers, data plotting and Geo-referencing. Please give me suggestions, how to start with it?
-
Did you already take a look at http://switch2osm.org? – scai Jan 22 '15 at 16:55
-
@scai is it in java? – Keshav Sharma Jan 22 '15 at 17:16
-
"It"? What are you talking about? switch2osm.org explains how to create OSM-based web maps. Depending on the specific task there are different tools available. – scai Jan 22 '15 at 18:09
1 Answers
From your description you actually need several things, not just some small sample:
- Client-side library for displaying static maps (ex: OpenStreetMap) and dynamic data.
- Server-side geospatial service to construct maps from your own shapefiles. That's for complex and larger, more static maps. You'd need a map authoring tool and geospatial server (they're usually paired together), to design maps, build tile image caches and publish as WMS/WMTS services, then you can display them on website together with OpenStreetMap.
- Custom web service to convert simple shapefiles or query results from spatial databases to any readable format supported by your client-side library. That's usually for dynamic, small-amount spatial data with minimal styling for plotting.
- If you want to organize simple shapefiles from 3., usually you'd also use a spatial database such as PostGIS/PostgreSQL or Microsoft SQL Server. They store geometry features in database columns and extend SQL to provide spatial operations such as Contains or Union, allowing you to query ordinary data and geometry features together, or return the results as readable formats such as WKT or GML. You'd need other utilities to load shapefiles into them though.
For 1, OpenLayers is among one of the most popular libraries for map on website. It's pure JavaScript and open-sourced, another option is Esri's ArcGIS SDK - they have SDKs for web (both of JavaScript and Silverlight) and many others; They are free for use and half of the functionality are provided as samples with source, such as map printing, and their SDKs support all open standards besides their own proprietary services. Both supports OpenStreetMap directly, and on Esri's website they have tutorials/samples for nearly every functions.
For 2, you can use free GeoServer or MapGuide (with authoring tool), or commercial ArcGIS server plus ArcMap as authoring tool.
For 3, you have to google. There should be plenty of libraries to load shapefiles. For spatial-database it's much easier, since they can be converted into human-readable WKB or GML by built-in functions in their SQL variants.
For 4, Microsoft SQL Server is the simplest to use, and the express edition is free, although feature-wise it sucks and its performance is terrible until 2012. PostGIS/PostgreSQL is more feature rich, including direct conversion between different coordinate systems. I have never used Oracle's but they support even the topology format.
PS: Although geospatial servers can also plot spatial data in real time and render them to bitmaps for website to display, it'd bog down your web server immediately. If you need to deal with dynamically plotting large set of spatial data, you'd have to experiment with canvas or SVG renderer in OpenLayers.

- 483
- 1
- 5
- 13