Hi Ben,
look at the following code. It works great for me. I just read the railroads from a Database
so you must change something.
Yours Ruediger
protected void calcList(GisOMGraphicList list, float minX, float maxX, float minY, float maxY)
{
final float[] pattern = { 0.75F, 9.25F };
final Stroke patternStroke, lineStroke;
Iterator it;
GisRailRoad grr;
float[] seq1, seq2, seq3;
GisOMPoly omPoly;
patternStroke = new BasicStroke(9, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 10.0f, pattern, 1.0F);
lineStroke = new BasicStroke(1, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND);
_tx.join();
it = _gisRootProvider.getIntersectBox(minX, maxX, minY, maxY, GisRailRoad.class, false);
while (it.hasNext())
{
grr = (GisRailRoad) it.next();
seq1 = grr.getSequence();
seq2 = new float[seq1.length];
seq3 = new float[seq1.length];
System.arraycopy(seq1, 0, seq2, 0, seq1.length);
System.arraycopy(seq1, 0, seq3, 0, seq1.length);
omPoly = new GisOMPoly(seq2);
omPoly.setAppObject(grr);
omPoly.setStroke(patternStroke);
list.addOMGraphic(omPoly);
omPoly = new GisOMPoly(seq3);
omPoly.setAppObject(grr);
omPoly.setStroke(lineStroke);
omPoly.setLinePaint(_railroadColor);
list.addOMGraphic(omPoly);
}
}
> -----Original Message-----
> From: Ben Podoll [mailto:benjamin.podoll_at_und.edu]
> Sent: Wednesday, August 25, 2004 4:05 AM
> To: openmap-users_at_bbn.com
> Subject: [OpenMap Users] railroad shapefile
>
> What is the best way to show a railroad shapefile using
> openmap? I have a shapefile that I want to use but it is hard
> to tell roads from railroads so I would like to possibly try
> and draw the tracks with the railroad ties on the map. Is
> that a ridiculous suggestion or has someone done that? (I
> don't even know if that would look good but figured I should
> ask - since it might)
>
> ~Ben
>
>
> --
> [To unsubscribe to this list send an email to "majdart_at_bbn.com"
> with the following text in the BODY of the message
> "unsubscribe openmap-users"]
>
--
[To unsubscribe to this list send an email to "majdart_at_bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Wed Aug 25 2004 - 02:39:17 EDT