Changeset 4972 in osm for applications
- Timestamp:
- 2007-10-13T18:02:56+02:00 (17 years ago)
- Location:
- applications/editors/josm/plugins/osmarender
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/osmarender/build.xml
r3786 r4972 2 2 3 3 <property name="josm" location="../../core/dist/josm-custom.jar" /> 4 <!--<property name="osmarender" location="../../../osmarender" />--> 5 <property name="osmarender" location="../../../../rendering/osmarender" /> 4 <property name="rendering" location="../../../../rendering" /> 6 5 7 6 <target name="compile"> … … 14 13 15 14 <target name="build" depends="compile"> 16 <copy todir="bin"> 17 <fileset dir="${osmarender}"> 18 <include name="osmarender.xsl"/> 19 <include name="osm-map-features.xml"/> 20 </fileset> 21 </copy> 15 <copy todir="bin" file="${rendering}/osmarender6/osmarender.xsl"/> 16 <copy tofile="bin/osm-map-features.xml" 17 file="${rendering}/osmarender5/osm-map-features-z17.xml"/> 22 18 <jar destfile="dist/osmarender.jar" basedir="bin"> 23 19 <manifest> -
applications/editors/josm/plugins/osmarender/src/OsmarenderPlugin.java
r2398 r4972 20 20 import org.openstreetmap.josm.data.osm.DataSet; 21 21 import org.openstreetmap.josm.data.osm.Node; 22 import org.openstreetmap.josm.data.osm.Segment;23 22 import org.openstreetmap.josm.data.osm.Way; 24 import org.openstreetmap.josm.data.osm.visitor.AddVisitor; 23 import org.openstreetmap.josm.data.osm.OsmPrimitive; 24 import org.openstreetmap.josm.data.osm.visitor.CollectBackReferencesVisitor; 25 25 import org.openstreetmap.josm.gui.MapFrame; 26 26 import org.openstreetmap.josm.gui.preferences.PreferenceDialog; … … 44 44 LatLon topRight = Main.map.mapView.getLatLon(Main.map.mapView.getWidth(), 0); 45 45 Bounds b = new Bounds(bottomLeft, topRight); 46 Collection<Node> nodes = new HashSet<Node>(); 46 CollectBackReferencesVisitor backRefsV = 47 new CollectBackReferencesVisitor(Main.ds, true); 47 48 DataSet fromDataSet = new DataSet(); 48 AddVisitor adder = new AddVisitor(fromDataSet);49 49 for (Node n : Main.ds.nodes) { 50 50 if (n.coor.isWithin(b)) { 51 n.visit(adder);52 n odes.add(n);51 fromDataSet.nodes.add(n); 52 n.visit(backRefsV); 53 53 } 54 54 } 55 Collection<Segment> segments = new HashSet<Segment>(); 56 for (Segment s : Main.ds.segments) { 57 if (nodes.contains(s.from) || nodes.contains(s.to)) { 58 s.visit(adder); 59 segments.add(s); 60 } 61 } 62 for (Way w : Main.ds.ways) { 63 for (Segment s : w.segments) { 64 if (segments.contains(s)) { 65 w.visit(adder); 66 break; 67 } 68 } 69 } 55 for (OsmPrimitive p : new HashSet<OsmPrimitive>(backRefsV.data)) { 56 if (p instanceof Way) { 57 backRefsV.data.addAll(((Way) p).nodes); 58 } 59 } 60 for (OsmPrimitive p : backRefsV.data) 61 fromDataSet.addPrimitive(p); 70 62 71 63 String firefox = Main.pref.get("osmarender.firefox", "firefox");
Note:
See TracChangeset
for help on using the changeset viewer.