I'm generating images from various sources and the projections are not necessarily known ahead of time. The images are subject to interpolation and other alterations while being rendered, but I can generate 2D arrays of latitude and longitude points that correspond to pixels in the rendered image.
I need to be able to draw geo-political boundaries on top of the images using the latitude/longitude arrays as a reference. I don't normally work with GIS type problems, but I've done some research and I think what I want to do is take in a shape file with lat/lon points defining line segments making up geo-political boundaries and interpolate the closest locations for the edges of those line segments on my image.
Although I have an idea for a general approach, is there a preferred way to do this in Java, or a library providing the functionality? I found GeoTools which would do what I want if the projection was known ahead of time, but I need to be able to generate overlays on the fly. In addition I need the following features:
- Must work with varying resolution, boundaries should still be legible when zoomed in heavily. That is, when a pixel in the source image is being represented by multiple pixels at the display, boundaries should be drawn gracefully.
- Must be able to render maps in real time, or at least with reasonable latency. Although the projections are not all necessarily known ahead of time, they will not change often. If some amount of automated preprocessing can be done ahead of time to improve performance, that is an option.
- An open source (but commercial friendly) solution is preferred, but I can go with a closed source solution if necessary.





