geopaparazzi / smash

Source code of the SMASH Android/iOS digital field mapping app.
https://www.geopaparazzi.org/smash/index.html
GNU General Public License v3.0
76 stars 26 forks source link

Supporting WFS-T #148

Closed mohammedX6 closed 3 years ago

mohammedX6 commented 3 years ago

I am wondering how to add QGIS/ARCGIS as feature layers ?

moovida commented 3 years ago

What exactly do you mean by QGIS/ARCGIS layers? SMASH supports Geopackage and Shaepfile (readonly).

mohammedX6 commented 3 years ago

I mean adding vector layer like this

mohammedX6 commented 3 years ago

for more clarification

Capture

frafra commented 3 years ago

I mean adding vector layer like this

That is a map from a website, not a file like a GeoPackage or a Shapefile. It doesn't really matter if it is shown by arcgis.com or another website, you still need a file. To add such vector to SMASH, you should download it first.

mohammedX6 commented 3 years ago

So there is no way to add a vector layer without depending on GeoPackage, I want to change from GeoPackage because I want to sync my vector layers back to server.

moovida commented 3 years ago

So you mean WFS, and moreover the transactional version. There is currently no implementation in flutter for that. I wish there was one. I think your best bet is to enhance the current PostGIS support. That works directly on the server. But it is a simple and plain test. It needs to be connected.

mohammedX6 commented 3 years ago

So you mean by enhancing the already implemented PostGIS support I can use WFS?

moovida commented 3 years ago

No, PostGIS would be an alternative. Implementing a WFS-T client is quite some work I think.

There is an implementation in leaflet: https://github.com/respec/leaflet.wfs-t that might be placed as flutter_map plugin I think. And if you do that, you sure get the hero of many in the communitiy :-)

mohammedX6 commented 3 years ago

Can I use the same flow GeoPackage used to create WFS plugin? I mean if there is anything that is already made that helps as a starting point.

moovida commented 3 years ago

For Geopackage and Postgis I followed the same flow. If you are going to implement the WFS-T plugin part, I will sure support you in the SMASH part and if necessary we can change the workflow to have a better abstraction.

mohammedX6 commented 3 years ago

Will I consider offline storage SQLite?

moovida commented 3 years ago

yes, or well, I would use Geopackage (which again is sqlite), because it gives you the possibility to insert feature tables and use the spatial indexes.

mohammedX6 commented 3 years ago

So you mean if I implement the WFS plugin correctly I can use the GeoPackage features?

moovida commented 3 years ago

If you use WFS for simple features yes. WFS can also have a very complex schema, but that is usually not something that is exposed for mobil editing. I am assuming also the leaflet wfs-t plugin works with simplefeatures. In SMASH up to now I have been using the EditableQueryResult to hold simple features information from databases. It is really simple though, you might need something more in future.

mohammedX6 commented 3 years ago

Yes, all my use cases are simple features, before I start working on the plugin I want to ask some questions :

  1. Should I use it as a plugin, or like GeoPackage /shapefile structure.
  2. How do I save layers into storage (assuming I get the data from WFS how do I save the data as GeoPackage ? ).
  3. How I will deal with edits in offline/online status.
mohammedX6 commented 3 years ago

For a temporary solution, I converted the WFS layer to GeoPackge using the ogr2ogr library, this should be done on the back-end, at the current time it supports many languages. go here for more information

moovida commented 3 years ago

Yes that is sure a good solution of your backend takes care of synching the geopackage back into the central database.