Changeset 34515 in osm for applications/editors/josm/plugins/gpsblam
- Timestamp:
- 2018-08-18T17:56:03+02:00 (6 years ago)
- Location:
- applications/editors/josm/plugins/gpsblam
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/gpsblam/.project
r32286 r34515 16 16 </arguments> 17 17 </buildCommand> 18 <buildCommand> 19 <name>net.sf.eclipsecs.core.CheckstyleBuilder</name> 20 <arguments> 21 </arguments> 22 </buildCommand> 18 23 </buildSpec> 19 24 <natures> 20 25 <nature>org.eclipse.jdt.core.javanature</nature> 26 <nature>net.sf.eclipsecs.core.CheckstyleNature</nature> 21 27 </natures> 22 28 </projectDescription> -
applications/editors/josm/plugins/gpsblam/build.xml
r33776 r34515 5 5 <property name="commit.message" value="Commit message"/> 6 6 <!-- enter the *lowest* JOSM version this plugin is currently compatible with --> 7 <property name="plugin.main.version" value="1 2636"/>7 <property name="plugin.main.version" value="14153"/> 8 8 9 <!-- 10 ********************************************************** 11 ** include targets that all plugins have in common 12 ********************************************************** 9 <!-- Configure these properties (replace "..." accordingly). 10 See https://josm.openstreetmap.de/wiki/DevelopersGuide/DevelopingPlugins 13 11 --> 12 <property name="plugin.author" value="Russell Edwards"/> 13 <property name="plugin.class" value="org.openstreetmap.josm.plugins.gpsblam.GPSBlamPlugin"/> 14 <property name="plugin.description" value="Analyse a set of GPS points to obtain its centre and direction of spread."/> 15 <property name="plugin.icon" value="images/mapmode/gpsblam_mode.png"/> 16 <property name="plugin.link" value="https://wiki.openstreetmap.org/wiki/JOSM/Plugins/GPSBlam"/> 17 <!--<property name="plugin.early" value="..."/>--> 18 <!--<property name="plugin.requires" value="..."/>--> 19 <!--<property name="plugin.stage" value="..."/>--> 20 21 <!-- ** include targets that all plugins have in common ** --> 14 22 <import file="../build-common.xml"/> 15 16 <!-- 17 ********************************************************** 18 ** dist - creates the plugin jar 19 ********************************************************** 20 --> 21 <target name="dist" depends="compile,revision"> 22 <echo message="creating ${ant.project.name}.jar ... "/> 23 <copy todir="${plugin.build.dir}/resources"> 24 <fileset dir="resources"/> 25 </copy> 26 <copy todir="${plugin.build.dir}/images"> 27 <fileset dir="images"/> 28 </copy> 29 <copy todir="${plugin.build.dir}/data"> 30 <fileset dir="data"/> 31 </copy> 32 <copy todir="${plugin.build.dir}"> 33 <fileset dir="."> 34 <include name="README"/> 35 <include name="LICENSE"/> 36 </fileset> 37 </copy> 38 <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}" manifestencoding="UTF-8"> 39 <!-- 40 ************************************************ 41 ** configure these properties. Most of them will be copied to the plugins 42 ** manifest file. Property values will also show up in the list available 43 ** plugins: https://josm.openstreetmap.de/wiki/Plugins. 44 ** 45 ************************************************ 46 --> 47 <manifest> 48 <attribute name="Author" value="Russell Edwards"/> 49 <attribute name="Plugin-Class" value="org.openstreetmap.josm.plugins.gpsblam.GPSBlamPlugin"/> 50 <attribute name="Plugin-Date" value="${version.entry.commit.date}"/> 51 <attribute name="Plugin-Description" value="Analyse a set of GPS points to obtain its centre and direction of spread."/> 52 <attribute name="Plugin-Icon" value="images/mapmode/gpsblam_mode.png"/> 53 <attribute name="Plugin-Link" value="https://wiki.openstreetmap.org/wiki/JOSM/Plugins/GPSBlam"/> 54 <attribute name="Plugin-Mainversion" value="${plugin.main.version}"/> 55 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/> 56 </manifest> 57 </jar> 58 </target> 23 59 24 </project> -
applications/editors/josm/plugins/gpsblam/src/org/openstreetmap/josm/plugins/gpsblam/GPSBlamInputData.java
r33776 r34515 9 9 import java.util.LinkedList; 10 10 11 import org.openstreetmap.josm.Main;12 11 import org.openstreetmap.josm.data.coor.CachedLatLon; 13 12 import org.openstreetmap.josm.data.gpx.GpxTrack; … … 15 14 import org.openstreetmap.josm.data.gpx.WayPoint; 16 15 import org.openstreetmap.josm.data.projection.Projection; 16 import org.openstreetmap.josm.data.projection.ProjectionRegistry; 17 17 import org.openstreetmap.josm.gui.MainApplication; 18 18 import org.openstreetmap.josm.gui.layer.GpxLayer; … … 30 30 GPSBlamInputData(Point p1, Point p2, int radius) { 31 31 Collection<Layer> layers = MainApplication.getLayerManager().getLayers(); 32 Projection projection = Main.getProjection();32 Projection projection = ProjectionRegistry.getProjection(); 33 33 for (Layer l : layers) { 34 34 if (l.isVisible() && l instanceof GpxLayer) { 35 for (GpxTrack track : ((GpxLayer) l).data.tracks) {35 for (GpxTrack track : ((GpxLayer) l).data.tracks) { 36 36 for (GpxTrackSegment segment: track.getSegments()) { 37 37 for (WayPoint wayPoint : segment.getWayPoints()) { … … 69 69 this.add(cll, wayPoint); 70 70 } 71 } // end if circular else line based selection72 } // end loop over wayponts in segment73 } // end loop over segments in track74 } // end loop over tracks in layer75 } // end if layer visible76 } // end loop over layers77 } // end constructor71 } 72 } 73 } 74 } 75 } 76 } 77 } 78 78 79 79 private void add(CachedLatLon cll, WayPoint wayPoint) { 80 80 this.add(cll); 81 81 Calendar day = new GregorianCalendar(); 82 day.setTimeInMillis((long) wayPoint.time*1000);82 day.setTimeInMillis((long) (wayPoint.time*1000d)); 83 83 day.set(Calendar.HOUR_OF_DAY, 0); 84 84 day.set(Calendar.MINUTE, 0); -
applications/editors/josm/plugins/gpsblam/src/org/openstreetmap/josm/plugins/gpsblam/GPSBlamMarker.java
r33776 r34515 11 11 import java.awt.geom.Point2D; 12 12 13 import org.openstreetmap.josm.Main;14 13 import org.openstreetmap.josm.data.coor.CachedLatLon; 15 14 import org.openstreetmap.josm.data.coor.EastNorth; 16 15 import org.openstreetmap.josm.data.projection.Projection; 16 import org.openstreetmap.josm.data.projection.ProjectionRegistry; 17 17 import org.openstreetmap.josm.gui.MapView; 18 18 … … 23 23 private static final double FAC = 2.45; // 2.45 gives 95% CI for 2D 24 24 25 /** construct a blammarker by analysis of selected GPS points */ 25 /** 26 * Construct a blammarker by analysis of selected GPS points 27 * @param inputData input data 28 */ 26 29 GPSBlamMarker(GPSBlamInputData inputData) { 27 Projection projection = Main.getProjection();30 Projection projection = ProjectionRegistry.getProjection(); 28 31 // get mean east, north 29 32 double meanEast=0.0, meanNorth=0.0; … … 67 70 68 71 // save latlon coords of the mean and the ends of the crosshairs 69 Projection proj = Main.getProjection();72 Projection proj = ProjectionRegistry.getProjection(); 70 73 mean = new CachedLatLon(proj.eastNorth2latlon(new EastNorth(meanEast, meanNorth))); 71 74 hair1Coord1 = new CachedLatLon(proj.eastNorth2latlon( … … 88 91 89 92 void paint(Graphics2D g, MapView mv) { 90 Projection projection = Main.getProjection();93 Projection projection = ProjectionRegistry.getProjection(); 91 94 g.setColor(Color.GREEN); 92 95 g.setPaintMode();
Note:
See TracChangeset
for help on using the changeset viewer.