Closed don-vip closed 6 years ago
If it's still up for grab I would like to do this :-)
Thank you @jreijn :+1: You're the first one to show up, please go ahead :) If you're new to JOSM development, here is the developer guide. Feel free to ask any question :)
@jreijn Great, yes go ahead. For your information: The GeoJSON plugin can be built using either Ant or Gradle, you can choose which one to use. The developer guide mainly covers the Ant way, for documentation about building with Gradle see https://gitlab.com/floscher/gradle-josm-plugin#readme or ask me.
Happy Hacking!
@floscher I'm not sure if you know about it, but I was wondering if there are any GeoJSON based POJOs available somewhere in the project? Otherwise I will create some myself.
@jreijn For GeoJSON primitives the classes from Jackson were used: https://github.com/JOSM/geojson/blob/14eab01cf9a24f2e2bd8c18ff7f40fe613695778/src/main/java/org/openstreetmap/josm/plugins/geojson/DataSetBuilder.java#L10-L20 So yes, you can create your own for use with the json-p API. If it's easily possible, maybe you could even directly create (J)OSM primitives without first instantiating objects representing the GeoJSON datastructure. But I'd leave that to you, how you want to implement it.
@floscher yeah I noticed those, but they are dependent on an external library that's build for Jackson. I'll see what I can do.
For reference you can take a look to OsmJsonReader
core class (which reads an Overpass API JSON OSM file, not a GeoJson). It might be very similar.
@don-vip wow great. Looks interesting!
Sorry for the delay. I was sick for a week. Let me know if it requires further improvements. I've tried the plugin with several geo json files and it seems to work nicely. I aso did some minor check style improvements.
Don't be sorry, thanks a lot for your work! I'm going to take a look :)
An optimization is missing: the jsonp classes should not be embedded into plugin jar file, as they are provided by JOSM core.
Ah yes. You are right. I guess they can use scope provided. Do you want me to create a new PR for that?
Yes, please :)
This plugin currently uses Jackson to convert GeoJSON. While it's surely easier to write it this way, it is a no-go for inclusion in JOSM core (#10), as JOSM already embeds json-p as JSON library. Once the plugin will migrate to this library it will be considered for inclusion.