I am using Geotools to parse and draw a shapefile.
Now; when I draw that map I receive coordinates with this bit of code for my Flight Line button.
void selectFeatures(MapMouseEvent ev) { /* * Construct a 5x5 pixel rectangle centred on the mouse click position */ if(currentClick%2 == 0){ startPoint = ev.getMapPosition(); currentClick++; }else{ endPoint = ev.getMapPosition(); currentClick++; } if(!startPoint.equals(null) && !endPoint.equals(null)){ System.out.println("The two positions are: Start - " + startPoint + "\nEnd - " + endPoint); System.out.println("Starting point is in "); } } Is there anyway to parse the map/shapefile data for the country that my startPoint and endPoint are in?
I can see by the Feature Info button that was built into the GeoTools demo there is a way to parse information from a point; but I am unsure of how to do this programmatically as the API is not very well documented.
أكثر...

Now; when I draw that map I receive coordinates with this bit of code for my Flight Line button.
void selectFeatures(MapMouseEvent ev) { /* * Construct a 5x5 pixel rectangle centred on the mouse click position */ if(currentClick%2 == 0){ startPoint = ev.getMapPosition(); currentClick++; }else{ endPoint = ev.getMapPosition(); currentClick++; } if(!startPoint.equals(null) && !endPoint.equals(null)){ System.out.println("The two positions are: Start - " + startPoint + "\nEnd - " + endPoint); System.out.println("Starting point is in "); } } Is there anyway to parse the map/shapefile data for the country that my startPoint and endPoint are in?

I can see by the Feature Info button that was built into the GeoTools demo there is a way to parse information from a point; but I am unsure of how to do this programmatically as the API is not very well documented.
أكثر...