Spatial

spatial panel regression in R: Error with spgm

最后都变了- 提交于 2020-01-16 12:37:12
问题 I have one problem with the spatial regression code shown below ( Code Example ). After I run the regression I get the following error Error in listw %*% as.matrix(ywithin) : Cholmod error 'X and/or Y have wrong dimensions' at file ../MatrixOps/cholmod_sdmult.c, line 90 When I remove the spatial dimension from the regression, the regression runs perfectly, so I guess the error might be in the spatial weight matrix. Could someone please help me address why this error occurs and recommend a

Fetching Multipoint Spatial Data in MySQL

有些话、适合烂在心里 提交于 2020-01-16 10:57:53
问题 I didn't find any answer how to select every point in multipoint data type in MySQL. I have multipoint that contains many points and I want to select every point by query and I can't figure it out. Any ideas? Table structure: Image Example data: Image In MySQL documentation I've found only this, but it didn't help: https://dev.mysql.com/doc/refman/8.0/en/fetching-spatial-data.html 回答1: If you are using MySQL >= 8.0.2, an option may be: DELIMITER // CREATE PROCEDURE `sp_test`(`p_id` BIGINT

Finding MSA for [Cityname, Statename]?

空扰寡人 提交于 2020-01-16 01:46:47
问题 I'm looking for an R package that helps me to find the respective Metropolitan Statistical Areas (MSA) for input data in the form of [Cityname, State Abbreviation]. For instance: "New York, NY", "San Francisco, CA" . I do not have: County name, ZIP Code, FIPS, or anything else. What I found: MSA to County Relationships (2015) are provided by the U.S. Census, as "Core based statistical areas (CBSAs), metropolitan divisions, and combined statistical areas (CSAs)". A " Principal cities of

Why are my buffered points oblong and not circle in SQL Server Management Studio - Spatial Results

无人久伴 提交于 2020-01-15 07:14:20
问题 When I apply STBuffer(1) to a Point in SQL Server Spatial, they show up as an oblong circle, instead of a perfect circle. Why is this? 回答1: The selected projection is Equirectangular , and not the more familiar Mercator that we see in Google Maps & Bing Maps. Change this and the points will show up as expected. More information about map projection here: http://en.wikipedia.org/wiki/Map_projection 来源: https://stackoverflow.com/questions/19693067/why-are-my-buffered-points-oblong-and-not

Plotting neighborhoods network to a ggplot maps

前提是你 提交于 2020-01-15 03:27:11
问题 How to insert spatial network plot to a ggplot library(rgeos) library(rgdal) library(dplyr) require(maps) require(viridis) library(ggplot2) library(spdep) some.eu.countries <- c( "Portugal", "Spain", "France", "Switzerland", "Germany", "Austria", "Belgium", "UK", "Netherlands", "Denmark", "Poland", "Italy", "Croatia", "Slovenia", "Hungary", "Slovakia", "Czech republic" ) # Retrievethe map data some.eu.maps <- map_data("world", region = some.eu.countries) # Compute the centroid as the mean

Creating and cropping grid in R (CRAN)

蹲街弑〆低调 提交于 2020-01-14 03:42:07
问题 I need to create a mask grid for spatial interpolation in gstat library. In details, I have different sampling points randomly distributed and I need to create the minimum convex polygon enclosing these points. Then, I have to create a spatial grid that should be cropped by the computed hull just to limit the interpolation to the extent of this polygon. I'd be very grateful if someone could explain me the detailed procedure also providing some examples. Thank you in advance. 回答1: I found the

MySQL Spatial CONTAINS shows wrong result

泪湿孤枕 提交于 2020-01-13 10:24:08
问题 I have a strange behavior of MySQL spatial search. I have created a polygon in a GEOM field (Portugal bounds), then I am trying to find a point inside -- it is found ok. The next try is to find a point that is outside a polygon but the query still returns 1 found row. Please help, what am I doing wrong? Why does it find a point outside a polygon? SQL Code for testing is below: CREATE TABLE IF NOT EXISTS `test` ( `id` int(11) NOT NULL AUTO_INCREMENT, `bounds` geometry NOT NULL, PRIMARY KEY (

Build error when using VS 11, .NET 4.5 and Entity Framework

佐手、 提交于 2020-01-13 09:16:49
问题 In Visual Studio 2010, my solution was using .NET 4.2 (Entity Framework June 2011 CTP) so I could use spatial types in Entity Framework. When I upgraded to Visual Studio 11 Beta, it wouldn't build because of conflicts between the 4.2 and 4.5 framework so I uninstalled 4.2. Now I get this error when I build: Error 209: Currently, spatial types are only supported when used in CSDL files that have the UseStrongSpatialTypes annotation with a false value on their root Schema element. Anyone know

MySQL INSERT/UPDATE on POINT column

我怕爱的太早我们不能终老 提交于 2020-01-12 05:39:54
问题 I'm trying to populate my DB with geographical places of my country. One of my tables have 4 fields: ID[PK], latitude. longitude ande geoPoint EDIT `SCDBs`.`Punto_Geografico`; SET @lat = 18.469692; SET @lon = -63.93212; SET @g = 'POINT(@lat @lon)'; UPDATE Punto_Geografico SET latitude = @lat, longitude =@lon, geoPoint =@g WHERE idpunto_geografico = 0; im getting the following error: Error Code: 1416 Cannot get geometry object from data you send to the GEOMETRY field I'm pretty sure that

How to replace NA's in a raster object

岁酱吖の 提交于 2020-01-12 03:21:50
问题 I need to replace the NA 's in the raster object ( r ) from the example below. library(raster) filename <- system.file("external/test.grd", package="raster") r <- raster(filename) I also tried to remove these these (and place the result in a data.frame ), but to no avail. dfr <- as.data.frame(r, na.rm=T) summary(dfr) # test # Min. : 128.4 # 1st Qu.: 293.2 # Median : 371.4 # Mean : 423.2 # 3rd Qu.: 499.8 # Max. :1805.8 # NA's :6097 回答1: I'm not sure it makes sense to remove NA values from a