Steven Fines wrote: > Description of the problem: > I have 18 shapefiles. All are georeferenced to the same area. 1 > contains the bounding polygons for the areas of interest (study file), > the remaining 17 do not (data files). I need to overlay the polygon > from the study file onto the other data files to get their data for > the time when the data was created. I need to be able to list the > study areas and then quickly pull up their historical data. > Sounds okay; in general the problem you are doing here is a "join" - something the library does not automatically do - you are are going to have to do this using nested for loops; you can check out the validation module for code examples that do similar kinds of work. > Possible solution (with questions): > 1) I filter my area of interest file for the Features which I need right now. > 2) from the resulting FeatureCollection I grab THE_GEOM which holds the jts > polygon of the feature itself. > Right - so for each area of interest ... > 3) To make these available for faster reference later, I need to save the > polygon into PostGIS in some fashion > *) if all of the files I'm using are georeferenced, do I need to save > any external information other than the polygon to locate the same > area on a different shapefile? > It is really kind if you keep track of the projection / epsg code / etc.... that way you will be able to use other tools (say uDig and GeoServer) to work on your data later.... also GeoTools is generally more useful when we know what the data means - it will be hard to "draw" any maps with out the CoordianteReferenceSystem information being available. > *) is there a way to load everything from the study file into PostGIS PostGIS ships with a shp2sql command line program that can be used to import your files into PostGIS. > , extract the polygon when I need it and apply it against the other shape > files? > If all you are worried about is answers ... ie a data product; load your data up in PostGIS (all of it) and use SQL statements to answer your question ... So "extract the polygon when needed" becomes: SELECT the_geom FROM AREA_OF_INTEREST WHERE ID=4
That will give you a literal geometry... "apply it against the other shapefiles" becomes ... SELECT * FROM OTHER_SHAPEFILE WHERE intersects( the_geom, ...your literal geometry ... ); You can do the same thing with nested for loops ... but I am not sure as to your goals. > 4) when I need to call up the other data, load the polygon from the study > file or data base > 5) create a filter with this polygon > 6) filter datafiles. > 7) display results in whatever format I need. > Okay; so the "display results" is the kicker; you have the correct idea ... create a filter for area of interest. Note if you grab the udig source code you can create this filter and place it on a "layer" and get the visual you need... and export it out to PDF etc... Not sure how tied you are to doing this on your own? > Does this seem correct to you? > Cheers, Jody ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Geotools-gt2-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
