Actually Steve's code works beautifully and does not seem to require much
modernization! I haven't tested it with a subsampled envelope yet, but it
spits out 4000x2000 rasters from big shapefiles in seconds. I only commented
out some (not all) debug printouts and added a function to produce a
GridCoverage2D directly:

    public GridCoverage2D rasterize(String name, FeatureCollection fc,
String attributeName, ReferencedEnvelope env)

you can pass null as the envelope and it will use the boundaries of the
feature collection. I also internalized the FeatureRasterizerException so
the code is now self-contained as long as geotools is in the classpath. It
does not use any deprecated API - that's the extent of my modernization
capabilities :)

If I find bugs along the way I'll try to fix them - progress can be followed
at
http://ecoinformatics.uvm.edu/crucible/browse/ThinklabGeospacePlugin/org/int
egratedmodelling/geospace/gis/FeatureRasterizer.java.

Bottom line: Thanks Steve!

Cheers,
ferdinando


-----Original Message-----
From: Jody Garnett [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, April 01, 2008 3:28 PM
To: Ferdinando Villa
Cc: 'Steve Ansari'; [email protected]
Subject: Re: [Geotools-gt2-users] Vector to Raster conversion

Hey guys; we are setting up a "Process" module in geotools (see this 
weeks IRC). After you do your "testing and modernize" do you want to 
send it our way? It woudl be great to have examples of different kinds 
of processes to make sure the API works out okay.
Jody

Attachment: FeatureRasterizer.java
Description: Binary data

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to