Tag Info

Hot answers tagged

2

This seems to work for me - I'm using the Admin Boundaries from Natural Earth and a Blue Marble jpeg (with a hand cranked world file) and this code which gives me this image. Without seeing your actual datafiles my suspicion is that you have a tiff file with either no world file or a broken one instead of a geotiff. If that is the case then you should be ...


1

I don't think that GeoTools can manage this out of the box. But the code shouldn't be too hard to knock up to handle your use case. The Image Tutorial will get you started with reading in and writing out geotiffs. There is certainly tiling code available in the new GeoPackage module that might already do what you need. You might also find JAITools (a ...


1

Ian's answer is correct, and I have marked it as such. For the sake of completeness for anyone else that might be interested... Question 1 No, you do not have to manually reproject layers. Specifying the projection on the viewport should suffice. Example: MapViewport vp = map.getViewport(); CoordinateReferenceSystem crs = ...


1

1) the map should handle the reprojection for you. See the QuickStart for an example. 2) you ask the map for it's maxBounds not current bounds, and you might want to clip by the CRS's DomainOfValidity to avoid unpleasant weirdness. 3) I'm not sure how you are generating your graticles but if you use the grids module you can densify the lines to make them ...


1

Something like: Coordinate[] coords = geometry.getCoordinates(); StringBuilder out = new StringBuilder(); out.append("coordinates="); boolean start = true; for(Coordinate c: coords) { if(!start){ out.append(","); }else{ start=false; } out.append(c.x+","+c.y); }



Only top voted, non community-wiki answers of a minimum length are eligible