gis

C#: How to determine if a coordinates is in the continental United States?

北城以北 提交于 2021-02-07 14:23:34
问题 I am getting coordinates - lat/lon and I want to check if these coordinates are in the continental United States or not. Is there a easy way to do it in C#? I can convert the coordinates into MGRS or UTM. Thanks! 回答1: Oh wow, they have it just for you: http://econym.org.uk/gmap/states.xml All the coords of the US states! Build up a polygon and apply any polygon-contains-point algorithm. The classic algorithm is ray-casting, and its even pretty simple. Let me know if you have any trouble with

Draw a parallel line in R offset from a line

隐身守侯 提交于 2021-02-07 06:23:06
问题 I have linestring which represent a driving journey down some streets. But I want to actually represent a cyclists journey, which is offset from the line i.e. they travel near the kerb of the road. I'm struggling with how to do it. I've made a reproducible piece of R code to illustrate. ## Let's say I have a route along some streets. library(ggplot2) ## It can be described by this data <- data.frame(x = c(1,3,10,5,0,5), y = c(1,3,1,0,5,7), label = c('a', 'b', 'c', 'd', 'e', 'f')) ##

Convert polygons into mesh

♀尐吖头ヾ 提交于 2021-02-07 00:00:24
问题 I have a lot of polygons. Ideally, all the polygons must not overlap one other, but they can be located adjacent to one another. But practically, I would have to allow for slight polygon overlap ( defined by a certain tolerance) because all these polygons are obtained from user hand drawing input, which is not as machine-precised as I want them to be. My question is, is there any software library components that: Allows one to input a range of polygons Check if the polygons are overlapped

Convert polygons into mesh

半世苍凉 提交于 2021-02-07 00:00:20
问题 I have a lot of polygons. Ideally, all the polygons must not overlap one other, but they can be located adjacent to one another. But practically, I would have to allow for slight polygon overlap ( defined by a certain tolerance) because all these polygons are obtained from user hand drawing input, which is not as machine-precised as I want them to be. My question is, is there any software library components that: Allows one to input a range of polygons Check if the polygons are overlapped

Fast python GIS library that supports Great Circle Distance and polygon

佐手、 提交于 2021-02-06 23:33:04
问题 I was looking for a geographical library for python. I need to be able to do the following: Get the distance between 2 points (in meters) using Great-circle distance (not liner distance calculation) Check if a point is inside a polygon Perform 1 and 2 couple of thousands times per seconds At start I've looked at this post: Python module for storing and querying geographical coordinates and started to use geopy. I've encountered 2 problems: Geopy doesn't support polygons High CPU usage of

Fast python GIS library that supports Great Circle Distance and polygon

僤鯓⒐⒋嵵緔 提交于 2021-02-06 23:32:13
问题 I was looking for a geographical library for python. I need to be able to do the following: Get the distance between 2 points (in meters) using Great-circle distance (not liner distance calculation) Check if a point is inside a polygon Perform 1 and 2 couple of thousands times per seconds At start I've looked at this post: Python module for storing and querying geographical coordinates and started to use geopy. I've encountered 2 problems: Geopy doesn't support polygons High CPU usage of

Calculating a radius with longitude and latitude [duplicate]

帅比萌擦擦* 提交于 2021-02-06 09:21:09
问题 This question already has answers here : Calculate distance between two latitude-longitude points? (Haversine formula) (44 answers) Closed 7 years ago . I am trying to determine if two locations (each with their own latitude and longitude values) are within a certain distance of each other, a 3 mile radius for example. I have double values to represent the latitude and longitude of each location. //Location 1 Double lattitude1 = 40.7143528; Double longitude1 = -74.0059731; //Location 2 Double

How to get the correct centroid of a bigquery polygon with st_centroid

可紊 提交于 2021-01-28 18:47:55
问题 I'm having some trouble with the ST_CENTROID function in bigquery. There is a difference between getting the centroid of a GEOGRAPHY column and from the same WKT version of the column. The table is generated using a bq load with a geography column and a newline_delimited_json file containing the polygon as wkt text. Example: select st_centroid(polygon) loc, st_centroid(ST_GEOGFROMTEXT(st_astext(polygon))) loc2,polygon from table_with_polygon Result: POINT(-174.333247842246 -51.6549479435566)

Street names in OSMNX network maps

守給你的承諾、 提交于 2021-01-28 08:45:20
问题 I am constructing street networks on osmnx using below code.I see that I can print lat/lon information, but Is there a way to include street/road names in network maps as well? I don't see how to do this in the documentation. Thanks! import osmnx as ox G = ox.graph_from_bbox(37.79, 37.78, -122.41, -122.43, network_type='drive') G_projected = ox.project_graph(G) ox.plot_graph(G_projected) Output: 回答1: Here's how you annotate your map with OSMnx to show street/road names (or any other edge

Using R intersections to create a polygons-inside-a-polygon key using two shapefile layers

不羁岁月 提交于 2021-01-28 08:00:52
问题 The data I have two shapefiles marking the boundaries of national and provincial electoral constituencies in Pakistan. The objective I am attempting to use R to create a key that will generate a list of which provincial-level constituencies are "contained within" or otherwise intersecting with which national-level constituencies, based on their coordinates in this data. For example, NA-01 corresponds with PA-01, PA-02, PA-03; NA-02 corresponds with PA-04 and PA-05, etc. (The key will