spatial4j | LocationTech Spatial4j: A Geospatial Library for Java | Map library

 by   locationtech Java Version: 0.8 License: No License

kandi X-RAY | spatial4j Summary

kandi X-RAY | spatial4j Summary

spatial4j is a Java library typically used in Geo, Map applications. spatial4j has no bugs, it has no vulnerabilities, it has build file available and it has medium support. You can download it from GitHub, Maven.

Spatial4j is a general purpose spatial / geospatial ASL licensed open-source Java library. It's core capabilities are 3-fold: to provide common shapes that can work in Euclidean and geodesic (surface of sphere) world models, to provide distance calculations and other math, and to read & write shapes from formats like WKT and GeoJSON. Spatial4j is a project of the LocationTech Industry Working Group of the Eclipse Foundation. If you are working with spatial grid-square indexing schemes, be it Geohash or something custom, then you are likely to find especially high utility from Spatial4j. Spatial4j is well tested; it's monitored via Travis-CI continuous integration (plus another Hudson build) and we use Codecov for code coverage. If you are interested in contributing to Spatial4j please review the contribution guidelines.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              spatial4j has a medium active ecosystem.
              It has 889 star(s) with 169 fork(s). There are 59 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 71 open issues and 78 have been closed. On average issues are closed in 124 days. There are 1 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of spatial4j is 0.8

            kandi-Quality Quality

              spatial4j has 0 bugs and 0 code smells.

            kandi-Security Security

              spatial4j has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              spatial4j code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              spatial4j does not have a standard license declared.
              Check the repository for any license declaration and review the terms closely.
              OutlinedDot
              Without a license, all rights are reserved, and you cannot use the library in your applications.

            kandi-Reuse Reuse

              spatial4j releases are available to install and integrate.
              Deployable package is available in Maven.
              Build file is available. You can build the component from source.
              Installation instructions are available. Examples and code snippets are not available.
              It has 11325 lines of code, 1121 functions and 116 files.
              It has high code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed spatial4j and discovered the below as its top functions. This is intended to give you an instant insight into spatial4j implemented functionality, and help decide if they suit your requirements.
            • Intersects the bounding box
            • Performs a spatial relation between a rectangle and b
            • Relates the circle wrapping around a circle
            • Returns the number of corners intersect
            • Initialize fields
            • Initialize the fields
            • Initializes a field
            • This method wraps a Geometry into a new Geometry
            • Shifts the given geometry by xShift
            • Expand a buffer for a bounding box segment
            • Adds the default writers
            • Calculate the bounding box by distance from the point to the specified point
            • Compares this line to another
            • Creates a string representation of a point
            • Finalize the hashCode
            • Calculates the hash code
            • Builds the supported formats
            • Compares this range with the specified range
            • Returns a string representation of this LineStringBuilder
            • Returns a point on the point on the bearing based on the bearing distance
            • Returns a cropped rectangle that contains the given distance
            • Creates a new SpatialContext based on the supplied arguments
            • Calculates the great circle distance from a point
            • Computes whether the given list of shapes intersects
            • Returns a string representation of the ShapeCollection
            • Compute the bounding box of the given geometry
            Get all kandi verified functions for this library.

            spatial4j Key Features

            No Key Features are available at this moment for spatial4j.

            spatial4j Examples and Code Snippets

            No Code Snippets are available at this moment for spatial4j.

            Community Discussions

            QUESTION

            Unknown Shape definition [CIRCLE]
            Asked 2021-Jan-23 at 10:22

            I'm trying to create a new document unfortunately I'm facing this kind of exception:

            Unable to parse shape given formats "lat,lon", "x y" or as WKT because java.text.ParseException: Unknown Shape definition [CIRCLE (2.175888 41.388587, 20)]

            This is my request :

            ...

            ANSWER

            Answered 2021-Jan-23 at 10:22

            CIRCLE shape is no more supported with Sorl. We should use instead SHAPE(POINT(lon lat), DISTANCE in °degree).

            Source https://stackoverflow.com/questions/65782007

            QUESTION

            Incorrect distance returned for indexed polygone shape
            Asked 2021-Jan-22 at 23:25

            I am using geodist() in Solr query. Following this select?=&fl=*,_dist_:geodist()&fq={!geofilt d=30444}&indent=on&pt=50.53,-9.5722616&q=*:*&sfield=geo&spatial=true&wt=json However, it seems like distance calculations aren’t working. Here’s an example query where the pt is several hundred kilometers away from the POLYGON. The problem that the calculated geodist is always 20015.115 .

            This is my query response:

            ...

            ANSWER

            Answered 2021-Jan-20 at 20:36

            The score=distance (or other distance-like options) is intended for indexing either points in RPT, or boxes (rectangles) with BBoxField. For that it works. If you index non-point data in RPT, the results will be erroneous and geodist gonna return always 20015.115

            The best quick solution is to add another field having a location type and perform distance calculation via geodist, for example:

            Source https://stackoverflow.com/questions/65805948

            QUESTION

            ElasticSearch hijacking typesafe config file contents
            Asked 2020-Dec-22 at 10:30

            I am trying to load a custom config for an elastic plugin, myConfig.conf, as so:

            ...

            ANSWER

            Answered 2020-Dec-22 at 10:30

            it is a bad idea to use external configuration files in elasticsearch plugin. ES provides a mechanism for extending the elasticsearch configuration. all of your custom config should be put in the elasticsearch.yml along with a custom setting registration in the plugin like so:

            Source https://stackoverflow.com/questions/65074016

            QUESTION

            A library corrupts classpath?
            Asked 2020-Sep-05 at 21:42

            There's a strange issue I've never seen.

            Adding a compile 'org.locationtech.spatial4j:spatial4j:0.7' to the dependencies list in my gradle project leads to a corrupt classpath. When I comment out that library and run java -verbose:class -jar sol_backend_full.jar > ok.log it outputs 4399 lines of class entries. However, with that library in classpath, java -verbose:class -jar sol_backend_full.jar > failed.log outputs only 953 lines, most of which are java.lang.* or sun.*.

            It obviously results in Error: Could not find or load main class.

            ➥ Has anyone ever encountered that strange behaviour?

            Of course, I can substitute that library with another spatial library, but what's happening is simply strange. It happens only with this library, removing/adding any other is fine.

            Gradle version in question is 5.5.1, and that library manifest looks a bit long, but not suspicious at all. Falling back to 4.8 also reproduces it.

            Here is the build script:

            ...

            ANSWER

            Answered 2020-Sep-05 at 21:42

            The JAR dependancy org.locationtech.spatial4j:spatial4j:0.7 is a signed jar. When you create a fat jar, java Classloader is not able to load the other classes from your fat jar because these are not signed.

            So, you can't create a fat jar with that dependancy without excluding the signatures.

            Please refer - Gradle - FatJar - Could not find or load main class

            Like mentioned in the above post, you may exclude the signatures like -

            Source https://stackoverflow.com/questions/63757382

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install spatial4j

            The facade to all of Spatial4j is the SpatialContext. It acts as a factory for shapes and it holds references to most other classes you might use and/or it has convenience methods for them. For example you can get a DistanceCalculator but if you just want to calculate the distance then the context has a method for that. To get a SpatialContext (or just "context" for short), you could use a global singleton SpatialContext.GEO or JtsSpatialContext.GEO which both use geodesic surface-of-sphere calculations (when available); the JTS one principally adds Polygon support. If you want a non-geodesic implementation or you want to customize one of many options, then instantiate a SpatialContextFactory (or JtsSpatialContextFactory), set the options, then invoke newSpatialContext(). If you have a set of name-value string pairs, perhaps from a java properties file, then instead use the static makeSpatialContext(map, classLoader) method which adds a lot of flexibility to the configuration initialization versus hard-coding it. You should generally avoid calling constructors for anything in Spatial4j except for the SpatialContextFactory. Constructors aren't strictly forbidden but the factories are there to provide an extension point / abstraction, so don't side-step them unless there's a deliberate reason.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            Install
            Maven
            Gradle
            CLONE
          • HTTPS

            https://github.com/locationtech/spatial4j.git

          • CLI

            gh repo clone locationtech/spatial4j

          • sshUrl

            git@github.com:locationtech/spatial4j.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link