GithubHelp home page GithubHelp logo

Comments (7)

wang-boyu avatar wang-boyu commented on May 26, 2024

I just noticed that epsg:4326 is the CRS for all GeoJSON: https://datatracker.ietf.org/doc/html/rfc7946#section-4

from mesa-geo.

Corvince avatar Corvince commented on May 26, 2024

I just noticed that epsg:4326 is the CRS for all GeoJSON: https://datatracker.ietf.org/doc/html/rfc7946#section-4

Yes, this was the reason I originally hardcoded it to epsg:4326. However, from re-reading the spec and looking around on the internet this is a bit unclear. I mean if there is no crs attribute it is correct to use epsg:4326, but if it is set we should respect it. Currently GeoDataFram.from_features is used, which does not seem to check the crs, but I am not sure

from mesa-geo.

Corvince avatar Corvince commented on May 26, 2024

BTW I really like your diagram!

But I think this boils a lot down to #48.

I might totally misrember that, but I think currently the CRS of the GeoSpace is only used for setting up the transformation inside MapModule. So it should probably removed from GeoSpace and the transformation inside MapModule (which should be renamed to LeafletMapModule) should transform from the agents CRS to epsg:4326

from mesa-geo.

wang-boyu avatar wang-boyu commented on May 26, 2024

Thanks a lot for your comments! I really need some opinions on how to design the GIS functionalities moving forward.

Yes, this was the reason I originally hardcoded it to epsg:4326. However, from re-reading the spec and looking around on the internet this is a bit unclear. I mean if there is no crs attribute it is correct to use epsg:4326, but if it is set we should respect it. Currently GeoDataFram.from_features is used, which does not seem to check the crs, but I am not sure

After reading more about GeoJSON, I am in fact thinking to honor the epsg:4326 gcs in its spec, as this might be the case in most other python packages. Thereafter we can use GeoJSON as the interfacing protocol between backend python modules and frontend js elements, much like what you were already doing, but probably with a few small changes.

I might totally misrember that, but I think currently the CRS of the GeoSpace is only used for setting up the transformation inside MapModule.

Yup this is correct.

So it should probably removed from GeoSpace and the transformation inside MapModule (which should be renamed to LeafletMapModule) should transform from the agents CRS to epsg:4326

If like I mentioned above, GeoJSON is still going to be used as the interface between backend & frontend, then the transformation of GeoAgent and GeoSpace into epsg:4326 can be done in their own __geo_interface__ functions respectively.

I am considering adding a crs attribute for GeoAgent objects, so that they can transform by themselves. When being added into GeoSpace, they will be transformed into the crs of GeoSpace. In this way we don't need the implicit constraint that AgentCreator and GeoSpace should have the same crs.

This is one of the things I'm working on at the moment. Will add you into the PR for your feedback when it's ready.

from mesa-geo.

Corvince avatar Corvince commented on May 26, 2024

After reading more about GeoJSON, I am in fact thinking to honor the epsg:4326 gcs in its spec, as this might be the case in most other python packages. Thereafter we can use GeoJSON as the interfacing protocol between backend python modules and frontend js elements, much like what you were already doing, but probably with a few small changes.

For writing GeoJSON we should definitely stick to epsg:4326, for reading (if crs present) - I have no idea how this is usually handled. But yeah, this was the originally idea of the geo_interface

If like I mentioned above, GeoJSON is still going to be used as the interface between backend & frontend, then the transformation of GeoAgent and GeoSpace into epsg:4326 can be done in their own __geo_interface__ functions respectively.

True.

I am considering adding a crs attribute for GeoAgent objects, so that they can transform by themselves. When being added into GeoSpace, they will be transformed into the crs of GeoSpace. In this way we don't need the implicit constraint that AgentCreator and GeoSpace should have the same crs.

That sounds like a sane approach.

This is one of the things I'm working on at the moment. Will add you into the PR for your feedback when it's ready.

Great! Really happy to see work being done on mesa-geo!

from mesa-geo.

wang-boyu avatar wang-boyu commented on May 26, 2024

Happy to hear some feedback from you too! We should have more conversations in the future : )

from mesa-geo.

wang-boyu avatar wang-boyu commented on May 26, 2024

Closed via #58.

from mesa-geo.

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.