-
Notifications
You must be signed in to change notification settings - Fork 61
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
Raster processing and digital elevation models #890
Conversation
baremaps-core/src/main/java/org/apache/baremaps/tilestore/raster/BicubicInterpolation.java
Fixed
Show fixed
Hide fixed
baremaps-core/src/main/java/org/apache/baremaps/tilestore/raster/GeoTiffReader.java
Fixed
Show fixed
Hide fixed
...ps-core/src/test/java/org/apache/baremaps/tilestore/raster/VectorHillshadeTileStoreTest.java
Fixed
Show fixed
Hide fixed
baremaps-dem/src/test/java/org/apache/baremaps/dem/HillShadeRenderer.java
Fixed
Show fixed
Hide fixed
baremaps-gdal/src/main/java/org/apache/baremaps/gdal/TranslateOptions.java
Fixed
Show fixed
Hide fixed
812b75e
to
a44233e
Compare
baremaps-gdal/src/main/java/org/apache/baremaps/gdal/TranslateOptions.java
Fixed
Show fixed
Hide fixed
3dbe1b7
to
7502fb1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Worked great, first time round. Thanks for the great work. Feel free to ignore my comments. One last suggestion: A legend informing of the height difference between 2 consecutive lines would be great.
|
||
var tileStoreSupplier = (Supplier<TileStore>) () -> tileCache; | ||
var tileStoreSupplier = (Supplier<TileStore<ByteBuffer>>) () -> tileCache; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A<B> = slippery slope but looks good and makes sense.
baremaps-core/src/main/java/org/apache/baremaps/tilestore/raster/GeoTiffReader.java
Outdated
Show resolved
Hide resolved
baremaps-core/src/main/java/org/apache/baremaps/tilestore/raster/RasterTileCache.java
Outdated
Show resolved
Hide resolved
var grid = geoTiffReader.read(tileCoord, 256, 4); | ||
|
||
int increment = switch (tileCoord.z()) { | ||
case 1 -> 2000; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe link (in javadoc) to some justification behind the reasoning of this mapping, rather than leaving "magic" numbers.
|
||
/** | ||
* A geometry transformer that applies the Chaikin smoothing algorithm to the coordinates of a | ||
* geometry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe a link explaining why/when to use this algorithm.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I improved the description of the chaikin smoother.
import javax.swing.*; | ||
import org.locationtech.jts.geom.Geometry; | ||
|
||
public class ContourRenderer { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Javadoc especially important since it has a main()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added some javadoc, but I don't intend to move this class out of the test directory.
import org.locationtech.jts.geom.Polygon; | ||
import org.locationtech.jts.geom.util.AffineTransformation; | ||
|
||
public class MarchingSquareRenderer extends JPanel { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Javadoc especially since it has a main()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, I added some javadoc, but this class will remain in the test directory.
- The idea is to access gdal in a more idiomatic way. - For instance AutoCloseable is used to release the underlying resources systematically. - Objects ease the creation of options.
- The ContourTracer implements marching squares to trace or polygonize contours. - The HillshadeCalculator computes raster hillshades. - Martini is a port of mapbox's martini algorithm to java. - The ChaikinSmoother enable the smoothing of linestring and polygons. - Some tests and utilities enable the verification of the results.
- Improve the TileStore abstraction so that it can support both raster and vector tiles. - Add some TileStore for dealing with raster tiles (geotiff, dem, cache, etc.).
- The server can now serve raster and vector tiles. - New assets allow the previsualisation of DEM data
efe2116
to
c44f398
Compare
Quality Gate passedIssues Measures |
@sebr72 Thanks a lot for the thorough review. I think I addressed most of your comments before squashing and merging. |
This pull request adds the ability to handle raster data and digital elevation models to produce vector contour and vector hillshades. Apache SIS is used to read raster data. While not used in core, a wrapper for GDAL has also been developped and may be used in workflow steps in the future. A few algorithms for converting raster data to vectors are also introduced.
The screenshot below depicts the convertion of a dem geotiff as terrarium png tiles, the creation of a raster hillshade, the creation of a vector hillshade, and the creation of vector contours.