{"id":19795603,"url":"https://github.com/dkogan/osmgnuplot","last_synced_at":"2025-05-01T03:30:29.151Z","repository":{"id":36493690,"uuid":"40799318","full_name":"dkogan/osmgnuplot","owner":"dkogan","description":"Script to make it easy to plot OSM tiles in gnuplot","archived":false,"fork":false,"pushed_at":"2025-03-31T22:28:01.000Z","size":26,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-31T23:27:09.883Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dkogan.png","metadata":{"files":{"readme":"README.pod","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":"2015-08-16T04:51:59.000Z","updated_at":"2025-03-31T22:28:05.000Z","dependencies_parsed_at":"2022-08-22T21:50:52.995Z","dependency_job_id":null,"html_url":"https://github.com/dkogan/osmgnuplot","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/dkogan%2Fosmgnuplot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dkogan%2Fosmgnuplot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dkogan%2Fosmgnuplot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dkogan%2Fosmgnuplot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dkogan","download_url":"https://codeload.github.com/dkogan/osmgnuplot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251817809,"owners_count":21648811,"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-12T07:16:48.870Z","updated_at":"2025-05-01T03:30:28.926Z","avatar_url":"https://github.com/dkogan.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"=head1 NAME\n\nosmgnuplot.pl - Download OSM tiles, and make a gnuplot script to render them\n\n=head1 SYNOPSIS\n\n $ osmgnuplot.pl --center 34.094719,-118.235779 --rad 300m --zoom 16\n Downloading http://tile.openstreetmap.org/16/11243/26158.png\n Downloading http://tile.openstreetmap.org/16/11244/26158.png\n Downloading http://tile.openstreetmap.org/16/11243/26159.png\n Downloading http://tile.openstreetmap.org/16/11244/26159.png\n Done! Gnuplot script 'montage_34.094719_-118.235779_300m_16.gp' uses the image 'montage_34.094719_-118.235779_300m_16.png'\n\n $ gnuplot -persist montage_34.094719_-118.235779_300m_16.gp\n [a gnuplot window pops up, showing OSM tiles]\n\n=head1 DESCRIPTION\n\nThis script downloads OSM tiles, glues them together into a single image, and\ngenerates a gnuplot script to render this image, aligned correctly to its\nlatitude, longitude (on the gnuplot y2 and x2 axes respectively). While this in\nitself is not useful, the gnuplot script can be expanded to plot other things on\ntop of the map, to make it easy to visualize geospatial data. Example plots\nappear here:\n\nL\u003chttp://notes.secretsauce.net/notes/2015/08/16_least-convenient-location-in-los-angeles-from-koreatown.html\u003e\n\nThe generated gnuplot script darkens the map a bit to make the extra stuff stand\nout (C\u003cattenuation\u003e parameter in the resulting script).\n\nThe communication with the OSM tile server assumes some caching. If an\nappropriately-named tile already exists on disk, the C\u003cIf-None-Match\u003e header\nfield is used to send over the MD5 hash of the tile on disk. If the tile on the\nserver has the same hash, the server doesn't bother sending it over, which\nresults in bandwidth savings.\n\nThe OSM tiles have a nonlinear relationship between longitude and tile pixels.\nThe gnuplot script generated here applies the nonlinearity to the y2 axis, so\nthe plotted image is not distorted, but the axes are still showing the correct\ndata. A side-effect of this is that latitude is on the y2 axis and longitude is\non the x2 axis. For instance, to plot a file C\u003clatlon.dat\u003e containing\nlatitude,longitude columns with points on top of the stitched OSM tiles, do this:\n\n  plot \"montage_....png\" ...., \\\n       \"latlon.dat\" using 2:1 with points axis x2y2\n\nThe C\u003c\"montage...\"\u003e stuff is generated by C\u003cosmgnuplot.pl\u003e, and the user would\nadd the C\u003c\"latlon.dat\"\u003e stuff.\n\nNote that some versions of gnuplot have a minor bug, and you may see the following message:\n\n warning: could not confirm linked axis inverse mapping function\n\nThis is benign, and can be ignored\n\n=head1 REQUIRED ARGUMENTS\n\n=over\n\n=item --center \u003clat\u003e,\u003clon\u003e\n\nCenter point\n\n=for Euclid:\n  lat.type: number\n  lon.type: number\n\n=item --rad \u003cradius\u003e\n\nHow far around the center to query. This must include units (support C\u003cm\u003e, C\u003ckm\u003e\nand C\u003cmiles\u003e; no whitespace between the number and units).\n\n=for Euclid:\n  radius.type: /[0-9]+(?:\\.[-9]*)?(?:miles?|km|m)/\n\n=item --zoom \u003czoom\u003e\n\nThe OSM zoom level\n\n=for Euclid:\n  zoom.type: integer, zoom \u003e 0 \u0026\u0026 zoom \u003c= 18\n\n=for Euclid:\n  radius.type: /[0-9]+(?:\\.[-9]*)?(?:miles?|km|m)/\n\n=back\n\n=head1 OPTIONAL ARGUMENTS\n\n=over\n\n=item --serverpath \u003curl\u003e\n\nThe base URL to grab tiles from. We default to the OSM tile server:\nC\u003chttp://tile.openstreetmap.org\u003e\n\n=for Euclid:\n  url.type: string\n  url.default: \"http://tile.openstreetmap.org\"\n\n=back\n\n=head1 DEPENDENCIES\n\nI use non-core perl modules C\u003cGetopt::Euclid\u003e and C\u003cLWP::UserAgent\u003e. I also use\nthe C\u003cmontage\u003e tool from C\u003cimagemagick\u003e. On a Debian box the following should be\nsufficient:\n\n apt-get install libgetopt-euclid-perl libwww-perl imagemagick\n\n=head1 REPOSITORY\n\nL\u003chttps://github.com/dkogan/osmgnuplot\u003e\n\n=head1 AUTHOR\n\nDima Kogan, C\u003c\u003c \u003cdima@secretsauce.net\u003e \u003e\u003e\n\n=head1 LICENSE AND COPYRIGHT\n\nCopyright 2015 Dima Kogan.\n\nThis program is free software; you can redistribute it and/or modify it under\nthe terms of the Lesser General Public License version 3, as published by the\nFree Software Foundation. Full text at http://www.gnu.org/licenses/lgpl.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdkogan%2Fosmgnuplot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdkogan%2Fosmgnuplot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdkogan%2Fosmgnuplot/lists"}