Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jts shading geotools integration #89

Closed
geoHeil opened this issue May 8, 2017 · 6 comments
Closed

Jts shading geotools integration #89

geoHeil opened this issue May 8, 2017 · 6 comments

Comments

@geoHeil
Copy link

geoHeil commented May 8, 2017

Could you add shading for the company.vividsolution.jts used in geospark?
I plan to ist geospark and geotools in a project and their respective transitive dependencies collide for jts.

http://stackoverflow.com/questions/13620281/what-is-the-maven-shade-plugin-used-for-and-why-would-you-want-to-relocate-java provide a good overview why to shade such closely coupled internal dependencies.

@geoHeil
Copy link
Author

geoHeil commented May 9, 2017

https://github.com/geoHeil/GeoSpark/tree/shadingJTS here is a prototype built with the instructions of http://stackoverflow.com/questions/21021485/how-to-configure-maven-shade-plugin-in-a-multi-module-project

Why did you not use the parent pom in the modules?

@geoHeil
Copy link
Author

geoHeil commented May 10, 2017

When not minimizing the resulting jar, the contents are fine. Whilst at it I would suggest to shade guava as well in order to not clash with i.e. geotools but mostly geospark

@geoHeil geoHeil mentioned this issue May 10, 2017
@jiayuasu
Copy link
Member

Hi @geoHeil , thanks for your comments! You gave me lots of great suggestion.

I have several questions about this issue: 1. In the new PR, it seems you create another module to make the shading work. This module packaged all GeoSpark and Babylon together. This is not expected. I will update JTSplus repository to avoid this conflict. 2. I am not sure why Guava is packaged into GeoSpark. I think I should totally exclude it. Will this solve the Guava conflict?

@geoHeil
Copy link
Author

geoHeil commented May 11, 2017

@jiayuasu , to my knowledge there are 2-3 Problems

What I want to achieve is: Read ESRi ASCII Grid files into geoSpark. Currently I use geotools to read the raster data and create polygons from it.
When having both geospark and geotools in the project, the wrong dependencies are selected. However when shading is applied as outlined above it works.

But it only works if the right assembly strategy (fat-jar) is applied when creating the spark job: http://stackoverflow.com/questions/43910006/geotools-jai-fatjar-causing-problems-in-native-dependencies do you know why the MergeStrategy.first is working (but has the downside that you do not know what first will be. The more elaborate strategy does seem to fail.

@jiayuasu
Copy link
Member

@geoHeil , I will do two things to help you out. 1. I will rename all JTSplus root package name. 2. Remove Guava dependency.

Guava dependency is introduced because GeoSpark 0.6.2 depends SerNetCDF which package lots of unrelated packages.

After this, I will push a snapshot version for you to test.

@jiayuasu
Copy link
Member

@geoHeil , in GeoSpark 0.7.0,

  1. I have integrated the latest GeoTools (17.0) into GeoSpark. I also removed all duplicated classes under JTS root folder. Only JTSplus version JTS exists in GeoSpark fat jar.

  2. I changed SerNetCDF to an optional dependency. Therefore, you won't see any unrelated libraries in the GeoSpark fat jar such as Guava.

Thanks,
Jia

@jiayuasu jiayuasu closed this as completed Jun 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants