grumlimited / geocalc Goto Github PK
View Code? Open in Web Editor NEWHelper classes to calculate Earth distances, bearing, etc.
License: BSD 3-Clause "New" or "Revised" License
Helper classes to calculate Earth distances, bearing, etc.
License: BSD 3-Clause "New" or "Revised" License
You are advertising version 0.5.8 but did not publish it on jitpack.
See for yourself:
You've forgotten to create the '0.5.8' tag :Ü™
I think I found a rounding issue in calculation of spherical law of cosines.
I have created a pull request for it (accompanied by unit-test) which sould explain this:
I've modified my pom.xml to include the dependency as written in your README, but the jar file isn't in maven. The URL for http://repo.maven.apache.org/maven2/com/grum returns a 404 response. Has this code been moved elsewhere?
10/22/14, 11:10:47 AM EDT: [INFO] Downloaded http://repo.maven.apache.org/maven2/com/grum/geocalc/0.1.2/geocalc-0.1.2.pom
10/22/14, 11:10:47 AM EDT: [WARN] The POM for com.grum:geocalc:jar:0.1.2 is missing, no dependency information available
10/22/14, 11:10:48 AM EDT: [INFO] Downloaded http://repo.maven.apache.org/maven2/com/grum/geocalc/0.1.2/geocalc-0.1.2.jar
10/22/14, 11:10:48 AM EDT: [INFO] Using 'UTF-8' encoding to copy filtered resources.
10/22/14, 11:10:48 AM EDT: [INFO] Copying 0 resource
10/22/14, 11:10:48 AM EDT: [INFO] Using 'UTF-8' encoding to copy filtered resources.
10/22/14, 11:10:48 AM EDT: [INFO] Copying 0 resource
10/22/14, 11:11:13 AM EDT: [WARN] The POM for com.grum:geocalc:jar:0.1.2 is missing, no dependency information available
BoundingArea area = EarthCalc.boundingArea(kew, 3000);
The boundingArea method does not exist it throws an error
I wanted to suggest you to update the readme to offer developers to use geocalc through Jitpack.io
You can see that the project is already available so it might ease the integration process for developers, and for you avoid the culprit of submitting the project on Maven central.
I tried it on one of my local project, and it worked smoothly. You did a great job guys ;)
I wanted to use your lib but getting under JDK16/JDK17 always the following error message:
"toDMSCoordinate() is not public in Coordinate; cannot be accessed from outside package"
The lib is on the classpath and not on the modulepath.
How can I use it ?
Can I set a BoundingArea area with a random shape, and use GeoCalc to determine whether a given Point is contained within that area ?
The distance calculation is only correct for small distances.
import com.grum.geocalc.*;
public class Bug {
public static void main(String[] args) {
//Kew, London
Coordinate lat = new DegreeCoordinate(51.4843774);
Coordinate lng = new DegreeCoordinate(-0.2912044);
Point kew = new Point(lat, lng);
//Buenos Aires, as per wolframalpha.com
lat = new DegreeCoordinate(34.61);
lng = new DegreeCoordinate(-58.37);
Point richmond = new Point(lat, lng);
double distance = EarthCalc.getDistance(richmond, kew); //in meters
System.out.println(distance);
}
}
As you can see in wolframalpha.com, it is supposed to be more than 11000 Km.
http://www.wolframalpha.com/input/?i=buenos+aires+to+london
standpoint is 31.194326398628462:121.42127048962534
forepoint is 31.194353394639606:121.4212814985147
bearing is 340.76940494442715
but the correct result is 19.213575108209017
It seems you have memorized the spelling of haversine incorrectly.
You spell it: haRvesine
While the correct spelling is: haveRsine
Here the wikipedia entry and a dictionary entry as source :Ü™
Have you thought about publishing the library to Maven's central repository?
I think it is a problem when using the library in a project.
I can help you publish it and automate it with travis.
look here: https://repo1.maven.org/maven2/com/github/
there's no subdir: grumlimited
http://artifactory.eu.moovitapp.com/artifactory/libs-release/com/github/grumlimited/geocalc/0.5.8/geocalc-0.5.8.pom => 404
http://artifactory.eu.moovitapp.com/artifactory/libs-release/com/github/grumlimited/geocalc/0.6/geocalc-0.6.pom => 404
The line here mentions the variable as EARTH_DIAMETER
https://github.com/grumlimited/geocalc/blob/master/src/main/java/com/grum/geocalc/EarthCalc.java#L44.
But as per the wiki the value corresponds to radius. Also as per the formula we should multiply with the radius.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.