Esri / geometry-api-java

The Esri Geometry API for Java enables developers to write custom applications for analysis of spatial data. This API is used in the Esri GIS Tools for Hadoop and other 3rd-party data processing solutions.
Apache License 2.0
694 stars 260 forks source link

feat: Geohash class #317

Open WenJJ2000 opened 8 months ago

WenJJ2000 commented 8 months ago

Hi, we (@WenJJ2000 @karlsb @burcukilic @muchembledMartin @LinusWallin) are a group of university students who would like to be assigned this issue. We have worked on the issue and here is our pull request.

Adds Geohash class and Geohash tests which has the following functionalities :

Solves issue #213

stolstov commented 8 months ago

Thank you for the contribution.

Could you format it using tabs, similar to other files in the repo?

I've done this:

        String geohash1 = "9qh9mzv6sgtkwz34";
        Envelope2D env1 = Geohash.geohashToEnvelope(geohash1);

and got

-38.41176850208285
-38.41176850241027
75.14555980573277
75.14555980556906

This is not what I expect to see. I checked with some other implementation and also with this website http://geohash.co/

        Point2D p = new Point2D(61.57057257930285, -43.79239231349915);
        System.out.println();
        for (int i = 0; i < 12; i++)
            System.out.println(Geohash.toGeohash(p, i + 1));

This prints

m
m2
m25
m25y
m25yc
m25yc5

The values seem to be correct, but it throws at trying to do more than that. I would expect at least 20 character supported.

WenJJ2000 commented 8 months ago

Hi @randallwhitman @stolstov ,the bugs should all have been fixed!