{"id":48070629,"url":"https://github.com/data-mechanics/geoql","last_synced_at":"2026-04-04T14:42:01.534Z","repository":{"id":57433854,"uuid":"85528595","full_name":"data-mechanics/geoql","owner":"data-mechanics","description":"Library for performing queries and transformations on GeoJSON data (with emphasis on support for abstract graph representations).","archived":false,"fork":false,"pushed_at":"2018-01-03T02:46:39.000Z","size":298,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-06T12:21:25.103Z","etag":null,"topics":["data-science","data-structures","geographic-data","geojson","geojson-library"],"latest_commit_sha":null,"homepage":"https://pypi.python.org/pypi/geoql","language":"Python","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/data-mechanics.png","metadata":{"files":{"readme":"README.rst","changelog":null,"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":"2017-03-20T02:47:35.000Z","updated_at":"2017-07-16T18:09:01.000Z","dependencies_parsed_at":"2022-08-29T17:30:28.193Z","dependency_job_id":null,"html_url":"https://github.com/data-mechanics/geoql","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/data-mechanics/geoql","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/data-mechanics%2Fgeoql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/data-mechanics%2Fgeoql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/data-mechanics%2Fgeoql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/data-mechanics%2Fgeoql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/data-mechanics","download_url":"https://codeload.github.com/data-mechanics/geoql/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/data-mechanics%2Fgeoql/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31403314,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T10:20:44.708Z","status":"ssl_error","status_checked_at":"2026-04-04T10:20:06.846Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["data-science","data-structures","geographic-data","geojson","geojson-library"],"created_at":"2026-04-04T14:42:01.471Z","updated_at":"2026-04-04T14:42:01.528Z","avatar_url":"https://github.com/data-mechanics.png","language":"Python","readme":"=====\ngeoql\n=====\n\nLibrary for performing queries and transformations on GeoJSON data (with emphasis on support for abstract graph representations).\n\n.. image:: https://badge.fury.io/py/geoql.svg\n   :target: https://badge.fury.io/py/geoql\n   :alt: PyPI version and link.\n\nPackage Installation and Usage\n------------------------------\n\nThe package is available on PyPI::\n\n    python -m pip install geoql\n\nThe library can be imported in the usual ways::\n\n    import geoql\n    from geoql import geoql\n\nExamples\n--------\nAn example of usage is provided  below::\n\n    import geojson\n    from geoql import geoql\n    import geoleaflet\n    import requests\n    \n    url = 'https://raw.githubusercontent.com/Data-Mechanics/geoql/master/examples/'\n    \n    # Boston ZIP Codes regions.\n    z = geoql.loads(requests.get(url + 'example_zips.geojson').text, encoding=\"latin-1\")\n    \n    # Extract of street data.\n    g = geoql.loads(requests.get(url + 'example_extract.geojson').text, encoding=\"latin-1\")\n    \n    g = g.properties_null_remove()\\\n         .tags_parse_str_to_dict()\\\n         .keep_by_property({\"highway\": {\"$in\": [\"residential\", \"secondary\", \"tertiary\"]}})\n    g = g.keep_within_radius((42.3551, -71.0656), 0.75, 'miles') # 0.75 miles from Boston Common.\n    g = g.keep_that_intersect(z) # Only those entries found in a Boston ZIP Code regions.\n    g = g.node_edge_graph() # Converted into a graph with nodes and edges.\n    g.dump(open('example_extract.geojson', 'w'))\n    open('leaflet.html', 'w').write(geoleaflet.html(g)) # Create visualization.\n\nAn alternative example of usage is provided  below (the below usage is deprecated but will remain supported)::\n\n    import geojson\n    import geoql\n    import geoleaflet\n    import requests\n    \n    url = 'https://raw.githubusercontent.com/Data-Mechanics/geoql/master/examples/'\n    \n    # Boston ZIP Codes regions.\n    z = geojson.loads(requests.get(url + 'example_zips.geojson').text, encoding=\"latin-1\")\n    \n    # Extract of street data.\n    g = geojson.loads(requests.get(url + 'example_extract.geojson').text, encoding=\"latin-1\")\n    \n    g = geoql.features_properties_null_remove(g)\n    g = geoql.features_tags_parse_str_to_dict(g)\n    g = geoql.features_keep_by_property(g, {\"highway\": {\"$in\": [\"residential\", \"secondary\", \"tertiary\"]}})\n    g = geoql.features_keep_within_radius(g, (42.3551, -71.0656), 0.75, 'miles') # Within 0.75 of Boston Common.\n    g = geoql.features_keep_intersecting_features(g, z) # Only those entries found in a Boston ZIP Code regions.\n    g = geoql.features_node_edge_graph(g) # Converted into a graph with nodes and edges.\n    open('example_extract.geojson', 'w').write(geojson.dumps(g))\n    open('leaflet.html', 'w').write(geoleaflet.html(g)) # Create visualization.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdata-mechanics%2Fgeoql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdata-mechanics%2Fgeoql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdata-mechanics%2Fgeoql/lists"}