Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a land mask file in netCDF (also in ascii, if needed) which basically consists of a lat/long pair and a boolean (1 or 0) determining if that value is over land or not. The thing is, I'm not really sure how to use this in my Java applications.

If I can create a WKT polygon from the boundary of land/water, that would be a huge help, but other wise I'm looking for answers on how to use the net CDF files in JAVA (I looked at the netCDF java stuff but wasn't sue how to use it for my purposes).

I grab points from another source and must determine if they are on land or not.

share|improve this question
up vote 4 down vote accepted

do you have to use that mask or could you load a shapefile (from say Natural Earth) and then do your look ups against those polygons? If you can then GeoTools ( should be able to do this quite easily.

In fact with a little more work you should be able to export the landmask from netCDF into a GeoTiff and use that in GeoTools too. Gdal can import netCDF (

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.