New answers tagged


Just to help anyone else who ends up here as I did recently! There is a bug in GeoTools that prevents DESCENDING working as a sort order. See this PR for the fix which will be applied shortly.


GeoTools works with Features so the only way to render things on the map is to have them be attributes in a Feature. So if you have a collection of features you want to draw and a list of other values that you also want to use in the renderer you need to add the "extra" variable onto the features that are being drawn. The quickest/easiest way to do this is ...


You need to check if the value of rotation is null using a function: First you need an if_then_else function to select the outputs based on the isNull function's result. If the property is null it returns true and the if_then_else returns the first argument (the literal), if it is not null then it returns false and the second argument of the if is used (the ...


You can start with geotools tutorials, which is helpful for beginners. It provides an introduction to GIS workshop making use of examples from GeoTools and other Java libraries.


You need to close the polygon by adding the start point to the end of the list of points that you build the WKT with. So change it to: for (var z = 0; z < arreglo.length; z++) { arreglo2.push(arreglo[z][0]+" "+arreglo[z][1]); } arreglo2.push(arreglo[0][0]+" "+arreglo[0][1]); But I'm pretty sure you can use the OpenLayers WKT ...


That note is over 7 years old so things have moved on a little since then :-) For current best practice you should look at the org.geotools.swing.tool package in the unsupported swing module. As far as I can see the idiom is to work directly on the MapPane passed in at construction.

Top 50 recent answers are included