Coder Social home page Coder Social logo

support for transactions about pygeoapi HOT 14 CLOSED

geopython avatar geopython commented on August 17, 2024
support for transactions

from pygeoapi.

Comments (14)

tomkralidis avatar tomkralidis commented on August 17, 2024 1

Makes sense. I imagine that functionality will be provider specific/dependent and that our provider base class would throw NotImplementedError by default.

from pygeoapi.

jachym avatar jachym commented on August 17, 2024 1

About the POST /item[s]/[uuid]

It IMHO should return 404, since the endpoint does not exist yet. I have nothing against having required [uu]id in the body of the request

from pygeoapi.

justb4 avatar justb4 commented on August 17, 2024 1

POST /collections/{collectionID}/items with a body of Item or even FeatureCollection (have seen latter somewhere, MapFish API?). Item already has an id-field (cannot find back if id is indeed mandatory, seems not in OAPIF. "id is a local identifier of the feature" and ... that strictly only the URI needs to be unique.

Some sources indicate that PUT should be used to add (if Entity not exists) or replace (if exists) a specific Entity (in our case Item):
https://restfulapi.net/rest-put-vs-post/

So

POST /collections/{collectionID}/items [obj]

Adds (new) Item (Feature) to the collection.

and

PUT  /collections/{collectionID}/items/{featureId} [obj]

would add or replace an Item with specific URI (id?).

Update: saw a more recent link to the Stac spec in Gitter from @cholmes, the above aligns with this:
https://github.com/radiantearth/stac-spec/tree/master/api-spec/extensions/transaction

from pygeoapi.

jachym avatar jachym commented on August 17, 2024

Create feature

POST /items/ [obj]

ID should not be forced while feature creation?

ID should be returned

from pygeoapi.

justb4 avatar justb4 commented on August 17, 2024

My $2ct: The "id thing" requires some thinking-through: it needs to be unique within a Collection on one hand, so IMHO cannot be enforced on the client (think of multiple clients POST/PUTing at the same time), unless maybe with UUIDs. WFS2 had an idgen option, remember? "The idgen attribute control how a WFS generates identifiers from newly created feature instances using the Insert action. The default action is to have the WFS generate a new id for the features. This is also backward compatible with WFS 1.0 where the only action was for the WFS to generate an new id. Don't know if we need this flexibility/complexity, just wanted to mention.
A use case for client-supplied id's are e.g. Cadastral Parcel id's (or INSPIRE-ids brr). Or in SensorWeb: station-ids.

Another example: With SensorThings API Transactions, when POSTing a Thing, the server always generates a unique id (within the Things Collection), but at same time allows a client to set a client-unique field, e.g. a station id within a free-form properties hashmap. So a client can always find back its Things (this was a severe limitation in SOS). Best of both worlds but then again STA has a fixed abstract entity model like an appschema.

from pygeoapi.

justb4 avatar justb4 commented on August 17, 2024

btw The STAC Pilot Transaction spec (to which OAPIF refers, see above) is IMHO not really clear on this: one POSTs an Item to a Collection and probably if the Item contains an id it is validated for uniqueness and used, otherwise generated (?), but id is mandatory in Item (?). That could be a simple solution without idgen...

from pygeoapi.

francbartoli avatar francbartoli commented on August 17, 2024

@justb4 I would also consider PATCH to change only a feature property:

PATCH /collections/{collectionID}/items/{featureId} [obj]

would change the field value of an item, it could also be the geometry

from pygeoapi.

justb4 avatar justb4 commented on August 17, 2024

@francbartoli thanks, yes PATCH for partial updates (except for id itself IMHO) should be considered.

from pygeoapi.

francbartoli avatar francbartoli commented on August 17, 2024

Sure @justb4, except the feature identifier

from pygeoapi.

tomkralidis avatar tomkralidis commented on August 17, 2024

Note: transactions draft now at http://docs.opengeospatial.org/DRAFTS/20-002.html

from pygeoapi.

francbartoli avatar francbartoli commented on August 17, 2024

Thanks @tomkralidis, very good reference to follow for the implementation

from pygeoapi.

p1d1d1 avatar p1d1d1 commented on August 17, 2024

What is the status here?

from pygeoapi.

tomkralidis avatar tomkralidis commented on August 17, 2024

For now, we continue to monitor the OGC draft for developments, contributions against are welcome.

from pygeoapi.

tomkralidis avatar tomkralidis commented on August 17, 2024

Implemented in #984

from pygeoapi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.