{"id":19668862,"url":"https://github.com/andrerav/geohash.spatialindex","last_synced_at":"2025-04-29T00:30:50.334Z","repository":{"id":45240672,"uuid":"355649301","full_name":"andrerav/Geohash.SpatialIndex","owner":"andrerav","description":"A spatial index backed by geohashing and trie maps.","archived":false,"fork":false,"pushed_at":"2021-12-28T20:33:12.000Z","size":34490,"stargazers_count":9,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-10T06:12:56.242Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andrerav.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-04-07T18:44:55.000Z","updated_at":"2024-01-11T18:05:25.000Z","dependencies_parsed_at":"2022-09-10T17:41:43.660Z","dependency_job_id":null,"html_url":"https://github.com/andrerav/Geohash.SpatialIndex","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrerav%2FGeohash.SpatialIndex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrerav%2FGeohash.SpatialIndex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrerav%2FGeohash.SpatialIndex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrerav%2FGeohash.SpatialIndex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andrerav","download_url":"https://codeload.github.com/andrerav/Geohash.SpatialIndex/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224140013,"owners_count":17262579,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T16:37:58.130Z","updated_at":"2024-11-11T16:37:59.053Z","avatar_url":"https://github.com/andrerav.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Geohash.SpatialIndex\n## Download\n\n| Package | Link |\n| ------- | ---- | \n| Geohash.SpatialIndex.Core | [![image](https://img.shields.io/nuget/v/Geohash.SpatialIndex.Core.svg)](https://www.nuget.org/packages/Geohash.SpatialIndex.Core/) |\n| Geohash.SpatialIndex.SpatialRelations | [![image](https://img.shields.io/nuget/v/Geohash.SpatialIndex.SpatialRelations.svg)](https://www.nuget.org/packages/Geohash.SpatialIndex.SpatialRelations/) |\n\n## Quickstart\nBuild the index:\n```csharp\nvar index = new GeohashSpatialIndex\u003cint\u003e(\n                  new DefaultGeohasher(), \n                  new DefaultTrieMap\u003cint\u003e(), \n                  precision: 9);\n```  \n\nFill the index with geometries:\n```csharp\nforeach(var obj in gisObjects)\n    index.Insert(obj.Geometry, obj);\n```\n\nQuery the index:\n```csharp\nvar result = index.Query(geom)\n```\n\nYou can also use one of the provided spatial relation functions provided which is backed by NetTopologySuite:\n```csharp\nvar relations = new GeohashSpatialIndexRelations\u003cMyGisObjType\u003e(index);\nvar result = relations.STIntersects(myGeom);\n```\n\n## Description\nA spatial index backed by geohashing and Trie (prefix tree) maps. Geometries are encoded as geohashes and stored in a prefix tree, and reverse lookups are performing by encoding the queried geometry and using the prefix tree as an inverted lookup index. The index size can be tuned with the precision parameter. The geohasher and prefix tree map providers can be injected by implementing the `IGeohasher` and/or `IGeohashTrieMap\u003cTEntryList, T\u003e` interfaces. This library ships with default implementations that uses [rm.Trie](https://github.com/rmandvikar/csharp-trie) and [geohash-dotnet](https://github.com/postlagerkarte/geohash-dotnet).\n\nBelow is an example with an index covering a set of polygons along the norwegian coastline:\n\n![image](https://user-images.githubusercontent.com/3635018/113932204-a1109e00-97f3-11eb-8549-7464224445d3.png)\n\nAnother example, an index covering some polygons in inner Oslo Fjord:\n\n![image](https://user-images.githubusercontent.com/3635018/113932377-d0270f80-97f3-11eb-9514-ab1a5bf1df8a.png)\n\nA final example, some polygons related to offshore installations in the north sea:\n\n![image](https://user-images.githubusercontent.com/3635018/113935496-ed111200-97f6-11eb-9e36-0157439fef06.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrerav%2Fgeohash.spatialindex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandrerav%2Fgeohash.spatialindex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrerav%2Fgeohash.spatialindex/lists"}