Spatial

R, Incorrect output from ggplot2 and facet_wrap when using spatial data

烂漫一生 提交于 2019-12-11 22:03:10
问题 I'm trying to create a visualisation of the UK for different time periods where the fill for each region depends on a numeric variable. When I split the dataframe by time period and create the charts independently in ggplot2, they are correct. However, when I use the facet_wrap function to have them appear in a single chart, the outputs are incorrect (the numbers for each region are not correct). (Note, I have tried to follow this tutorial for spatial data in R as closely as possible: http:/

Entity Framework 5: DbGeography

大兔子大兔子 提交于 2019-12-11 18:44:01
问题 I'm trying to access the DbGreography datatypes in my solution. I've installed EF5 via nuget. I've referenced System.Data.Entity in which the spatial types are supposed to reside. However, There dont seem to be any system.data.spatial namespace in there. I'm using vs.net 2012 also. What am I missing here? 回答1: The geography types are in System.Data.Entity assembly version 4.0.0.0. If your project was targeting a different framework when you installed EF5, you may well have got a reference to

Find points within a circle using hibernate Spatial criteria - distanceWithin

两盒软妹~` 提交于 2019-12-11 16:54:39
问题 I have a domain object car . One of the car properties is location stored in MySQL as spatial type Point ( columnDefinition can't be of Geometry , throws an exception). @Type(type="org.hibernate.spatial.GeometryType") @Column(name = "location", columnDefinition="Point") private Point location; Using hibernate spatial criteria I would like to get those that are in a certain radius. In native sql I could use ST_Distance_Sphere , but I would like to use criteria instead. The problem is, that

How can I include survey weights in a poisson pint process model fitted to a logistic regression quadrature scheme?

ε祈祈猫儿з 提交于 2019-12-11 14:37:08
问题 Is it possible to include weights in a poisson point process model fitted to a logistic regression quadrature scheme? My data is a stratified sample and I would like to account for this sampling strategy in order to have valid population level predictions. 回答1: Here are a few lines to elaborate on the answer by @adrian-baddeley. If you have the setup of your related question and we imagine you have the weights and two covariates in a data.frame in the same order as the points of your

Using a spatial database to find polygons that contain a point

妖精的绣舞 提交于 2019-12-11 13:54:22
问题 I'm using MongoDB to store spatial records. Some records are polygons, and others are points. Data is being continually inserted. I need to be able to access all records whose polygon contains a point. Mongo's spatial queries allow finding all points within a polygon, but not all polygons that contain a point. Is there a good way to do this in MongoDB another database system? 回答1: Unfortunately, there is no way to run this query at present -- unless you're willing to simplify the application

Drawing anonymous circles in Google Maps

懵懂的女人 提交于 2019-12-11 12:53:09
问题 I'm trying to draw a google maps that has multiple Circle overlays, however I do not want to reveal the correct center of the radius. So for example, myLatlng is my lat/lon center of the radius, I want to draw a circle not around it, but a circle that will include that point. This is how I currently draw my circle: var myLatlng = new google.maps.LatLng(33.33333,22.22222); var circle = new google.maps.Circle({ map: map, radius: 3218, strokeColor: "#FFAA00", fillColor: "#00AAFF", fillOpacity: 0

Finding shortest distance between two polygons(SqlGeography c# )

前提是你 提交于 2019-12-11 12:48:31
问题 I want to find the shortest distance between two SqlGeography polygon. I know there is a method ShortestLineTo (https://msdn.microsoft.com/en-us/library/ff929252.aspx) but it gives empty string while doing so. Can anyone suggest me some alternate way to do so? 回答1: You should define a GEOGRAPHY in Counter Clockwise order. If you define it CW, it will be all the world except the region you are defining: DECLARE @G1 GEOGRAPHY = 'POLYGON ((1 1, 3 1, 3 3, 1 3, 1 1))'; DECLARE @G2 GEOGRAPHY =

Lat/Long Conversion to UTM Loop (R code)

余生长醉 提交于 2019-12-11 11:49:26
问题 I apologize in advance for my beginner question, but R spatial analysis is completely new to me. I'm trying to convert an entire dataset (lat,long) into UTM for Ecuador (zone=17). My code below is only converting the first lat/long coordinates. Any advice would be greatly appreciated! require(proj4) require(rgdal) require(sp) require(proj4) ## Load dataset, total h7_x length = 327463 h7 <- read.csv('h7.csv', header=T) h7 <- data.frame(x=h7$h7_x, y=h7$h7_y) ## Convert Lat/Long to UTM

Select items within range using MySQL spatial extensions?

半世苍凉 提交于 2019-12-11 11:42:23
问题 I am completely new to MySQL spatial extensions, so please excuse my ignorance on the topic. The scenario: 1) I collect a user's location via latitude and longitude. I store that location in a MySQL table. 2) I then display any other users within a range of that user. The range would be small - let's say 1000 ft. Question: What is the best practice for storing the location points? What is the best practice for querying and selecting the points nearest that user? 回答1: Use the POINT Spatial

SQL Server Circle

旧巷老猫 提交于 2019-12-11 11:16:21
问题 I'm trying to create a circle in a SQL Server based on a midpoint and a radius. This seems to be close as a solution, but it creates an oval or an ellipse vs a circle. Is there another way to create a circle? DECLARE @g geometry; SET @g = geometry::STGeomFromText('POINT(-88.0 44.5)', 4326); select @g.BufferWithTolerance(5, .01, 1) I'm currently using SQL Server 2008. This code also demonstrates the problem. The spatial results look like a circle, but when I draw the circle on google maps it