Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [maptools]

Set of tools for manipulating and reading geographic data, in particular ESRI shapefiles; C code used from shapelib. It includes binary access to GSHHG shoreline files. The package also provides interface wrappers for exchanging spatial objects with packages such as PBSmapping, spatstat, maps, RArcInfo, Stata tmap, WinBUGS, and Mondrian

2
votes
1answer
70 views

Wait for user selection from user interface

I am making a custom maptool for QGIS I am overriding canvasReleaseEvent. when the user clicks on part of map canvas I call another function which identifies and creates a list of identified feature (...
5
votes
2answers
96 views

Dragging all veritices at a given point programmatically in pyqgis

I'm writing a Plugin where you build networks with point and line geometries. One Tool should give the User the possibility to make changes to the network by dragging and dropping the points to ...
1
vote
0answers
87 views

could not find function “merge_eurostat_geodata”

Just a couple of codes with the same error at the time of merge data: FIRST CODE: library(eurostat) library(dplyr) library(ggplot2) library(stringr) fer <- search_eurostat("fertility") ...
0
votes
1answer
224 views

Mapping data: error in classIntervals: var is not numeric

When executing the 'classIntervals' command I got the error while mapping data from Eurostat. library(rgdal) library(RColorBrewer) library(sp) library(GISTools) library(classInt) library(maptools) ...
2
votes
1answer
150 views

sf equivalent of R maptools package's SpatialLinesMidPoints

I've been moving most of my workflow to using the sf package in R, and I'm trying to find the equivalent to the maptools package SpatialLinesMidPoints function - I've used this function frequently ...
3
votes
1answer
250 views

PyQGIS/QGIS2.18 : Get currently active map tool

I would like to get the name of the map tool currently in use in QGIS, so that my plugin can react accordingly. The idea would be to do something a bit like akbargumbira's answer to that other ...
1
vote
1answer
80 views

Kernel Density Map points rejected as outside window

I am trying to make a kernel density plot of a points shapefile like so: library(rgdal) library(spatstat) library(maptools) points <- readOGR(dsn = "C:\\Documents", layer = "...
3
votes
1answer
1k views

Bind polygon centroid to polygon attribute data

I am trying to bind a dataframe containing polygon centroids to the polygon attributes. Here's what I've done so far to create the centroids: library(rgdal) library(PBSmapping) library(maptools) ...
2
votes
0answers
104 views

SpatialPolygonsDataFrame chloroplethr not writing to KML for GoogleMaps using R

I'm trying to do a simple chloropleth map for postal codes. I have the orginal kml exported here. When importing into R, i'm doing: library(rgdal) library(rworldmap) library(plotKML) library(...
4
votes
1answer
468 views

Plotting shapefile in R: how to delete selected borders?

I'm plotting a shapefile in R and would like to delete certain borders to "group" shapes together. For example, in the plot below, how would I delete the borders between the three blue counties and ...
0
votes
1answer
2k views

simple plotting of (latitude, longitude) points on a global map

I have a dataframe like the following: country <- c('US', 'CA','TW') city <- c('Atlanta','Halifax','Taipei') lat <- c(33.8004, 44.6500, 25.0392 ) lon <- c( -84.3865,-63.6000,121.5250 ) ...
1
vote
1answer
37 views

How can I merge data back to SpatialPolygon (or retain initially) after nowrapRecenter command?

I am using newobj <- nowrapRecenter(obj), from the package maptools to recenter a SpatialPolygonsDataFrame such that longitude runs 0 - 360 (pacific view) rather than -180 to 180 (Atlantic view). ...
5
votes
1answer
1k views

Dissolve only overlapping polygons in R

I have a spatialpolygons-dataframe in R that contains overlapping polygon features. I would like to dissolve only the overlapping features into separate polygon features (one feature per par of ...
4
votes
1answer
827 views

Road snapping in R - snapPointsToLine / Projection Problem

1. Introduction (you may skip this if you like) In order to implement a road snapping feature in R for recorded positioning data, I first searched the internet for possible solutions to the problem: ...
1
vote
1answer
96 views

problem with qgsmaptoolpan

i am using the c++ api qgis 2.8.2 i have a strange problem when i want to use the pantool for my canvas i used this code : mpPanTool = new QgsMapToolPan((QgsMapCanvas*)mpMapCanvas); ((QgsMapToolPan*)...
-2
votes
1answer
4k views

How can open a shapefile using R maptools package? [closed]

library(maptools) mn.map.shp = readShapeSpatial("minnesota.shp") Results this error at second line: Error in getinfo.shape(fn) : Error opening SHP file
0
votes
1answer
513 views

Creating polygonal windows for spatial analysis in r

I am attempting to normalize a spatial point pattern using a population density raster in r. My problem is that the function I am trying to run is recognizing the "white space" around the raster I am ...
6
votes
1answer
3k views

ggmap: clip a map

I'm using ggmap to grab Washington DC and I have a shapefile that I downloaded from here: library(ggplot2) library(ggmap) library(maptools) dc = get_map(location = 'DC', zoom = 12) nhbds = ...
21
votes
3answers
22k views

Merging multiple SpatialPolygonDataFrames into 1 SPDF in R?

I have created 2 polygons in QGIS. Using them in R, polygons become automatically SpatialPolygonsDataFrame (SPDF). I would like to merge them into single SPDF (as is super easy in ArcGis using Tool ...
0
votes
1answer
59 views

How to display the map within two longitude lines

I am new to GIS and I try to use the following code to display a pacific-centered world map. +proj=robin +lon_0=-198 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs However the map ...
5
votes
3answers
1k views

Dissolving/Unifying Ill Behaved/Irregular Polygons in R

I'm working on a project involving bringing together multiple subjects circling difficult to find parts of an image. The output from users is pretty awesome. Cool, right? However, what I want is to ...
3
votes
1answer
301 views

Association shapefiles to custom data in R

I have an Australia shapefile (can be found here http://www.abs.gov.au/AUSSTATS/abs@.nsf/DetailsPage/1259.0.30.001July%202011?OpenDocument) and some custom data which contains latitudes and ...
0
votes
1answer
237 views

How to choose a shapefile interactively in R

I am writing a function in R where i want the user to choose a Esri shapefile from its destination folder. Since a shapefile is made of several files how can i select them. For a point feature class i ...
2
votes
1answer
1k views

Trying to limit my shapemap to state boundary lines in R

I have a feeling I'm either trying to do this incorrectly, or I'm just not searching for the correct terms, but I cannot figure out how to do what I want to do. I am trying to plot the ranges of fish ...
2
votes
1answer
192 views

Encoding error between maptools and ArcGIS

I am having a trouble of encoding at writing shapefile by maptools (0.8-34) of R by MacOSX and reading that by ArcMap 10.2.1 in Windows 8.1 through parallels desktop. Using an original shapefile, I ...
3
votes
1answer
129 views

CRS not embedded by maptools in R

I'm using the maptools package in R to merge some data to a shapefile. When I open the original input shapefile in QGIS, QGIS automatically picks up on the CRS. When I open the output shapefile from ...