[gdal-dev] netCDF to Shapefile

Manuel Rainer manuelrainer at hotmail.com
Wed Mar 16 03:45:07 EDT 2011


Ok, here are more details:
 
I am using Python (2.6) together with netCDF4, numpy and gdal/ogr.
So far, I am able to read the dimensions, attributes and variables.
 
I have to choose records depending on certain time slices and export these
records together with their dimensions into a shapefile.
So, if four time slices are selected four shp files will be created.
 
Currently, I am designing a GUI with Tkinter for data I/O and time slice selection.
For the conversion task i would prefer a direct method without caching into a file.
I may use normal arrays or pytables....
 
Just wanted to know what is the more efficient method for caching the data.
 
Thanks for your support Mike!

 
> Date: Wed, 16 Mar 2011 16:21:23 +1100
> Subject: Re: [gdal-dev] netCDF to Shapefile
> From: mdsumner at gmail.com
> To: manuelrainer at hotmail.com
> CC: gdal-dev at lists.osgeo.org
> 
> Hi Manuel, I think you will still need to be more specific. You've
> indicated that the data is points, but not what the variables in the
> file are, which variables need to be interrogated for coordinates vs.
> values, what their dimensions are, whether you want several
> shapefiles, or just one with (say) multiple attributes, etc.
> 
> There are a number of ways to convert such data to shapefile, but it
> might be best to choose a reasonably easy scripting language to do it,
> such as Python or R - and so there are probably better forums than
> this for your problem.
> 
> Either way you'll need to provide a lot more detail - it's likely to
> be a two step process, with converting the NetCDF grids to tables (in
> memory or file), and then those to point shapefiles.
> 
> Cheers, Mike.
> 
> On Wed, Mar 16, 2011 at 3:17 PM, Manuel Rainer <manuelrainer at hotmail.com> wrote:
> > Thanks for your help,
> > it has to be a Shapefile because we do some further processing (symbology,
> > map creation...).
> > The netCDF file contains hydrodynamics point data.
> >
> > Best regards
> > Manuel
> >
> > ________________________________
> > Date: Wed, 16 Mar 2011 09:32:16 +0530
> > Subject: Re: [gdal-dev] netCDF to Shapefile
> > From: chaitanya.ch at gmail.com
> > To: manuelrainer at hotmail.com
> > CC: gdal-dev at lists.osgeo.org
> >
> > Manuel,
> >
> > Shapefile is for vector formats alone. Try a raster format to convert the
> > netCDF data.
> >
> > As for the performance, you don't need to cache anything. But it may help to
> > tweak the GDAL_CACHEMAX setting.
> > http://trac.osgeo.org/gdal/wiki/FAQRaster#Howtoimprovegdalwarpperfomance
> >
> > On Wed, Mar 16, 2011 at 8:21 AM, Manuel Rainer <manuelrainer at hotmail.com>
> > wrote:
> >
> > Hi,
> >
> > I would like to convert certain time slices (records) out of a netCDF file
> > to a Shapefile.
> > The netCDF file has 7> GB, so what is the best proceed to get an appropriate
> > performance?
> > I mean, should the data be cached (e.g. in an ASCII file, ...)
> > before writing a Shapefile or can the shp directly be generated?
> > Perhaps you have some experiences...
> >
> > Thanks for your help!
> > Best regards
> > Manuel
> >
> >
> >
> > _______________________________________________
> > gdal-dev mailing list
> > gdal-dev at lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/gdal-dev
> >
> >
> >
> > --
> > Best regards,
> > Chaitanya kumar CH.
> > /tʃaɪθənjə/ /kʊmɑr/
> > +91-9494447584
> > 17.2416N 80.1426E
> >
> > _______________________________________________
> > gdal-dev mailing list
> > gdal-dev at lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/gdal-dev
> >
> 
> 
> 
> -- 
> Michael Sumner
> Institute for Marine and Antarctic Studies, University of Tasmania
> Hobart, Australia
> e-mail: mdsumner at gmail.com
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20110316/239b9d1a/attachment.html


More information about the gdal-dev mailing list