I was debating with one of my collegues on OpenLayers v/s Leaflet. I made a point that OpenLayers is much better API if we wish to build a project, where you need direct connectivity to the Geoserver and PostGIS.
Then I found Open Data Kit, which looks pretty new but has the features of connectivity with the Geoserver and PostGIS.
So my project details are as follows,
- Use the map interface to fetch Feature Info
- Create a customized tool that takes the lat/lon from user as to where he/she clicks on the map and then fetches the Climate Data from the raster (which is handled by a py script on the server)
- Allows user to upload excel, which is sent to the py script, which returns a GeoJSON, which creates Vector Features on the map
- Allow user to create vector polygons, which will fetch the Features it intersects from the WFS Layer.
- Fetches Layer from the PostGIS Datastore on GeoServer and displays the layers on the map.
So now I am confused on which is better and why using OpenLayers over Leaflet makes more sense or not?
Answer
I have used both OpenLayers and Leaflet in my apps. There has been so much discussion on this topic in this forum and others on planet-internet. They usually fall into 2 camps - features and flexibility of OpenLayers versus simplicity of Leaflet. I would not be surprised if someone spawns an "OpenLeaf" initiative soon marrying the best of both worlds!
I found Leaflet very simple to use, a petite 64K size, compared to over 700K Openlayers, and in very few steps you can create apps that have the freshness and eye-candy of today's web and mobile GIS apps. Your stack - GeoServer, PostGIS etc., is a standard stack, so OpenLayers or Leaflet could easily be incorporated.
Having said that, I would still go with OpenLayers for the following reasons
- There is just a TON of material around OpenLayers. It is a lot more mature than Leaflet.
- Check out the comparison on commits and users.
- OpenLayers, GeoServer, PostGIS stack is so proven in the FOSS world that you are going on a path that is solid.
- OpenLayers has tad bit more features on Map Controls.
- While its a bit more work to create transitions and visual-effects, it can be done in OpenLayers.
No comments:
Post a Comment