open-location-code | Open Location Code is a library to generate short codes
kandi X-RAY | open-location-code Summary
kandi X-RAY | open-location-code Summary
Codes are made up of a sequence of digits chosen from a set of 20. The digits in the code alternate between latitude and longitude. The first four digits describe a one degree latitude by one degree longitude area, aligned on degrees. Adding two further digits to the code, reduces the area to 1/20th of a degree by 1/20th of a degree within the previous area. And so on - each pair of digits reduces the area to 1/400th of the previous area. As an example, the Parliament Buildings in Nairobi, Kenya are located at 6GCRPR6C+24. 6GCR is the area from 2S 36E to 1S 37E. PR6C+24 is a 14 meter wide by 14 meter high area within 6GCR. A "+" character is used after eight digits, to break the code up into two parts and to distinguish codes from postal codes. There will be locations where a 10 digit code is not sufficiently precise, but refining it by a factor of 20 is i) unnecessarily precise and ii) requires extending the code by two digits. Instead, after 10 digits, the area is divided into a 4x5 grid and a single digit used to identify the grid square. A single grid refinement step reduces the area to approximately 3.5x2.8 meters. Codes can be shortened relative to a location. This reduces the number of digits that must be remembered, by using a location to identify an approximate area, and then generating the nearest matching code. Shortening a code, if possible, will drop four or more digits from the start of the code. The degree to which a code can be shortened depends on the proximity of the reference location. If the reference location is derived from a town or city name, it is dependent on the accuracy of the geocoding service. Although one service may place "Zurich" close to the Google office, another may move it by a hundred meters or more, and this could be enough to prevent the original code being recovered. Rather than a large city size feature to generate the reference location, it is better to use smaller, neighbourhood features, that will not have as much variation in their geocode results. Guidelines for shortening codes are in the [wiki] Recovering shortened codes works by providing the short code and a reference location. This does not need to be the same as the location used to shorten the code, but it does need to be nearby. Shortened codes always include the "+" character so it is simple to compute the missing component.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Initializes the view
- Handle a geo intent
- Get the status bar height
- Search for an OLC code
- Returns the OpenLocationCode object for the given search string
- Return a full OpenLocationCode object from the given reference location
- Creates a short representation of the OpenLocationCode with the given reference point
- Decodes the given OpenLocationCode object
- Generate suggestions list for a given location
- Returns a list of localities for a given location and map location
- Called when a sensor is changed
- Read the screen rotation
- Opens the share menu
- Saves the current camera position in the map
- Handles a connection failure
- Called when text is clicked
- Initialize the UI
- Creates a new location listener
- Called when a new location is changed
- Restore the map camera position
- Open menu item click
- Called when the map is ready
- Initializes the welcome page
- Called when a location is updated
- Navigate
- Creates a list of locales without code
open-location-code Key Features
open-location-code Examples and Code Snippets
Community Discussions
Trending Discussions on open-location-code
QUESTION
I am trying to figure out a way to draw Pluscodes (OLC) on React Leaflet. I can get it to draw normal grids by extending GridLayer class just fine, but couldn't draw pluscodes accordingly. I am yet to figure out how it works completely.
How can I achieve this? Is GridLayer suitable for this task or should I be looking for something else? Also pluscodes should show higher levels as I zoom in.
https://codesandbox.io/s/pluscode-grid-problem-40fho?file=/src/App.jsx
...ANSWER
Answered 2021-Aug-07 at 15:42Unbeliveable, the answer was right there in the page I sourced in the question... Once again I choose to skim through documentations quickly to save few minutes only to lose days in the process.
Anyways, grid.plus.codes provides a grid service for plus codes which can easily be used with React leaflet like so:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install open-location-code
You can use open-location-code like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the open-location-code component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page