I have the "stable" release 2.3.x.
I have a customers shapefile which needs to be
displayed in our stand alone application's JPanel.
The shapefile contains lat/long points but has no
projection info (no associated .prj file).
I am attempting to reproject from this data as
WGS1984 to another projection (e.g. Lambert
Conformal).
Is there a way I can minimally test if I have my
development environment set up properly for
hsql db access?
Is there a decent example on how to construct
a CoordinateReferenceSystem from one of the
factory authority providers? The solution does
not necessarily have to be to Lambert Conformal.
I have the hsql jar (plugin) in my classpath. I am
guessing this should be relatively easy to do but
I seem to be reading conflicting solutions. To tell
you the truth I am not even certain I am attempting
this in a preferred manner.
Regards,
Evan Polster
I have some code which I cobbled together from
apparently viable examples on line.
String typeName = store.getTypeNames()[0];
FeatureSource source = store.getFeatureSource(typeName);
FeatureResults fsShape = source.getFeatures();
FeatureCollection fsColl = fsShape.collection();
System.out.println(fsColl.size() + " features found in " +
f.getName());
FeatureType fsType = source.getSchema();
FeatureIterator iter = fsColl.features();
Feature f1,f2,f3;
f1 = iter.next();
f2 = iter.next();
f3 = iter.next();
firstThreeColl = FeatureCollections.newCollection();
firstThreeColl.add(f1);
firstThreeColl.add(f2);
firstThreeColl.add(f3);
StyleBuilder sb = new StyleBuilder();
LineSymbolizer lineSymb = (LineSymbolizer)
sb.createLineSymbolizer(Color.yellow, 1);
Style aStyle = sb.createStyle(lineSymb);
CoordinateReferenceSystem ORIGIN_CRS =
DefaultGeographicCRS.WGS84;
MapContext map = new DefaultMapContext(ORIGIN_CRS);
map.addLayer(firstThreeColl,aStyle);
StreamingRenderer renderer = new StreamingRenderer();
renderer.setContext(map);
Graphics2D g2 = (Graphics2D)myJPanel.getGraphics();
PointLL lowerLeft =
_content.getMapDescriptor().getLowerLeft();
PointLL upperRight =
_content.getMapDescriptor().getUpperRight();
Coordinate lowerCoord = new
Coordinate(lowerLeft.getLat(),lowerLeft.getLon());
Coordinate upperCoord = new
Coordinate(upperRight.getLat(),upperRight.getLon());
Envelope envelope = new Envelope(lowerCoord,upperCoord);
// ----->> (then a miracle happens) ...
LAMBERT_CONFORMAL_CRS = ?
ReferencedEnvelope refEnv = new
ReferencedEnvelope(envelope,LAMBERT_CONFORMAL_CRS);
Rectangle vpRect = myJPanel.getBounds();
renderer.paint(g2, vpRect, refEnv);
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users