Skip to content

BDMS-31:Implement Location/Thing API endpoints in GeoDjangoPOC#9

Open
jacob-a-brown wants to merge 63 commits intopre-productionfrom
dev_jab
Open

BDMS-31:Implement Location/Thing API endpoints in GeoDjangoPOC#9
jacob-a-brown wants to merge 63 commits intopre-productionfrom
dev_jab

Conversation

@jacob-a-brown
Copy link
Contributor

BDMS-31:Implement Location/Thing API endpoints in GeoDjangoPOC

Enables API users to query /thing, /thing/{thing_id} and /location to obtain feature collections of things, specific things, and all locations.

Why

This PR addresses the following problem / context:

  • Enables thing and location to be retrieved for display in front end applications
  • Enables us to become more familiar with Django to make a more informed decision on a framework for current and future projects.

How

Implementation summary - the following was changed / added / removed:

  • Tests were developed that determined the output from the different endpoints. After the tests were developed, the endpoints were developed (along with schemas for the response models)
  • The output schemas are based on the models in the API. The FeatureCollection schema is generic and can return properties of the two sub-types that were defined in the proof of concept (well, spring)

Notes

Any special considerations, workarounds, or follow-up work to note?

  • This PR incorporates the changes in PR dev_kas #8. This PR should not be reviewed and merged until dev_kas #8 is.
  • The code is not very well organized or optimized, but since this is mostly an exercise in educating ourselves and in the interest of time I spent little time on repository structure and cleanliness. Would you like for me to clean it up and optimize it some more?
    • If we choose to move forward with Django I will definitely spend time cleaning up this code and putting it into logical directory/file structures, as well as writing faster and cleaner queries.

Copy link
Contributor

@chasetmartin chasetmartin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, seems like we should merge these PRs to keep the GeoDjango POC up to date with the latest work.

My only question that is not important: does geodjango have any built in functions in the ORM for creating geojson or shapefile responses?

@jacob-a-brown
Copy link
Contributor Author

In the few forums I've looked at it doesn't seem the case. We could use GeoDataFrames from GeoPandas to create the shapefile and then zip them and return them from the endpoint

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants