-
-
Save jegade/f7c2a2aa92eabbaa6331 to your computer and use it in GitHub Desktop.
Check if coordinate in poly-file perl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env perl | |
use Math::Polygon::Tree; | |
# nrw.poly - shapefile of nrw from http://download.geofabrik.de/europe/germany/nordrhein-westfalen.poly | |
my $bound = Math::Polygon::Tree->new( 'nrw.poly' ); | |
if ( $bound->contains( [6.744400, 50.797427] ) ) { | |
say "In nrw"; | |
} | |
unless ( $bound->contains( [ 8.378689, 50.434742] ) ) { | |
say "not in nrw"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment