MobilityData / gtfs-validator

Canonical GTFS Validator project for schedule (static) files.
https://gtfs-validator.mobilitydata.org/
Apache License 2.0
284 stars 100 forks source link

Flex: Investigate integration of geojson files #1758

Closed emmambd closed 2 months ago

emmambd commented 4 months ago

In order to support Flex, we need to add locations.geojson to our schemas and validate against it.

We need to investigate what library to use to best support this and how to test it adequately.

davidgamez commented 4 months ago

Timebox: 2days

qcdyx commented 2 months ago

1. GeoTools GeoTools is an open-source Java library that provides tools for geospatial data manipulation, including support for reading and writing GeoJSON.

2. GeoJSON-Jackson GeoJSON-Jackson is a library that integrates Jackson (a popular JSON processing library) with GeoJSON, providing a straightforward way to serialize and deserialize GeoJSON objects in Java.

Scope and Functionality GeoTools is a comprehensive geospatial data processing library that supports a wide range of data formats, including GeoJSON, Shapefiles, GML, and more. It provides tools for advanced geospatial operations such as spatial analysis, data transformation, and visualization. GeoTools is suitable for applications requiring extensive geospatial data manipulation capabilities.

GeoJSON-Jackson is a more focused library that integrates Jackson (a popular JSON processing library) with GeoJSON. It is designed specifically for serializing and deserializing GeoJSON data to and from Java objects. GeoJSON-Jackson is ideal for applications that primarily work with GeoJSON data and require straightforward serialization/deserialization without the need for complex geospatial operations.

Ease of Use GeoTools has a steeper learning curve due to its extensive functionality and the complexity of some of its operations. However, it provides powerful capabilities for those who need to perform advanced geospatial data processing.

GeoJSON-Jackson is simpler to use for tasks related to GeoJSON, thanks to its focus on serialization and deserialization. It's a good choice for projects that need to quickly and easily work with GeoJSON data in Java without the overhead of a larger geospatial library.

Performance GeoTools is designed for high-performance geospatial data processing, but its broader scope means that it might introduce more overhead than necessary for projects that only require GeoJSON handling.

GeoJSON-Jackson is likely to be more lightweight and faster for GeoJSON-specific tasks, as it does not include the extensive geospatial processing capabilities that GeoTools offers. This makes it a more efficient choice for projects focused solely on GeoJSON data.

Use Case Examples Use GeoTools if you are developing a complex geospatial application that requires reading, writing, and processing a variety of geospatial data formats, performing spatial analysis, or integrating with geospatial databases.

Use GeoJSON-Jackson if your application primarily deals with GeoJSON data and you need a straightforward way to serialize and deserialize GeoJSON objects in Java. It's particularly well-suited for applications that do not require the full suite of geospatial operations provided by GeoTools.

Conclusion In summary, the choice between GeoTools and GeoJSON-Jackson should be based on the specific needs of your project. For advanced geospatial data processing and support for multiple data formats, GeoTools is the better option. For simpler projects focused on GeoJSON data handling, GeoJSON-Jackson offers a more streamlined and efficient approach.

qcdyx commented 2 months ago

https://docs.google.com/document/d/1QABoIeOdR6lAB7A6_X6WIbZwC7EnAIZvm_hRNwNQeoI/edit GeoJSON-Jackson does not have built-in visualization features while GeoTools includes capabilities for rendering and visualizing geospatial data. GeoTools stand out since we need to visualize shape of the overlapping geometries in Phase 2.

qcdyx commented 2 months ago

Conclusion: we can use GeoTools as the library for reading in locations.geojson file. It's open source and it supports visualization of geospatial data.

I'll add how to set up GeoTools gradle dependencies in #1750.