shapefile

Manipulate shapefile attribute table using R

别来无恙 提交于 2019-12-20 10:10:57
问题 I've posted this question on the GIS stack exchange, but it's not seeing much traffic. I'm a GIS user who's been using R for stats for a few years, and I'm excited to see a lot of new GIS capabilities being released (raster, shapefiles, rgdal, etc). I've done a lot of database and table manipulation in R, so being able to add and remove attributes from shapefiles is a powerful potential. I'm hoping I'm just missing what's out there, but I can't seem to find a good method for adding or

How to add shapefiles to a Bing Map using Openlayers 3

我是研究僧i 提交于 2019-12-20 06:12:18
问题 I am using Openlayers3 with Bing Maps to build my application. I have a point shapefile and would like to show it on the map. I could do it using Openlayers2 using the OpenLayers.Layer.GML() construct but am facing difficulty while trying to the same with Openlayers 3. I tried searching for this and the openlayer example gives me an error: 'Cannot read property 'ogc' of undefined'. My shapefile is on GeoServer in my own system. So any help regarding this matter is highly appreciated :) 回答1:

Shapefile to raster conversion in R?

≡放荡痞女 提交于 2019-12-19 05:55:11
问题 I have a shapefile downloaded from the worldwildlife.org for the terrestrial ecoregions of the world. The file can be loaded here: http://worldwildlife.org/publications/terrestrial-ecoregions-of-the-world. It comes as a standard shape file and I would like to do two things with it. First: take the shapefile from my local directory and clip it to an extent of eastern North America (ext= extent (-95, -50, 24, 63)) # Read shapefile using package "maptools" eco_shp <- readShapeLines("F:/01_2013

Error opening SHP file in R using maptools readShapePoly

风流意气都作罢 提交于 2019-12-18 14:16:13
问题 I am new to R and was following the following tutorial on the ggplot2 package found here. However the readShapePoly() function throws an error whenever I try to load the basic shapefile. I have used the following code: library("ggplot2") library("gpclib") library("maptools") setwd("~/Documents/R Projects/Intro to ggplot2") #Intro to ggplot 2 contains the .shp file and associated data sport <- readShapePoly("london_sport.shp") which gets me: Error in getinfo.shape(filen) : Error opening SHP

How to use set clipped path for Basemap polygon

喜你入骨 提交于 2019-12-18 12:35:41
问题 I want to use imshow (for example) to display some data inside the boundaries of a country (for the purposes of example I chose the USA) The simple example below illustrates what I want: import numpy as np import matplotlib.pyplot as plt from matplotlib.patches import RegularPolygon data = np.arange(100).reshape(10, 10) fig = plt.figure() ax = fig.add_subplot(111) im = ax.imshow(data) poly = RegularPolygon([ 0.5, 0.5], 6, 0.4, fc='none', ec='k', transform=ax.transAxes) im.set_clip_path(poly)

How/Where do I get geoJSON data for states, provinces, and administrative regions of non-US countries?

吃可爱长大的小学妹 提交于 2019-12-18 09:59:35
问题 I need geoJSON formatted paths for states, provinces, and regions within multiple countries. Most readily available geoJSON data is for US states and country level boundaries, not regions within the country. This geoJSON will be used to create a geographic visualization using D3.js. 回答1: This process is now simplified (July 2014) compared to the steps I see in the accepted answer. It now seems much easier to get this data. I at first floundered around the web hoping I could just download a

Shapefile to Topojson conversion

核能气质少年 提交于 2019-12-18 07:02:08
问题 I am trying to convert the Ghana admin1 shapefile that can be found here. My end goal is to obtain a TopoJSON as described in this question. I have used this command on a Linux machine: ogr2ogr -f GeoJSON GHA_adm1.json GHA_adm1.shp And it returns this: Unable to open datasource `GHA_adm1.shp' with the following drivers. ... here goes a long list of drivers... I am I doing something wrong? Should I install other "drivers"? But how? Thanks. 回答1: Download the GIS source GADM is the perfect

Shapefile to Topojson conversion

ぃ、小莉子 提交于 2019-12-18 07:01:21
问题 I am trying to convert the Ghana admin1 shapefile that can be found here. My end goal is to obtain a TopoJSON as described in this question. I have used this command on a Linux machine: ogr2ogr -f GeoJSON GHA_adm1.json GHA_adm1.shp And it returns this: Unable to open datasource `GHA_adm1.shp' with the following drivers. ... here goes a long list of drivers... I am I doing something wrong? Should I install other "drivers"? But how? Thanks. 回答1: Download the GIS source GADM is the perfect

Append/Combine Shape Files

杀马特。学长 韩版系。学妹 提交于 2019-12-18 05:12:47
问题 I have a very simple operation I would like to perform: combining two shape files. Specifically, I have census tract shape files for each state in the US that I would like to combine into one shape file. Ultimately, I want to take the combined shape file and perform an overlay on a set of latitude and longitude coordinates, to determine which census tracts my coordinates fall into. I have seen much discussion on this (Combining bordering shapefiles in R). However, all of the discussion are

shapefile and matplotlib: plot polygon collection of shapefile coordinates

拥有回忆 提交于 2019-12-17 18:34:05
问题 I'm trying to plot filled polygons of countries on the world map with matplotlib in python. I've got a shapefile with country boundary coordinates of every country. Now, I want to convert these coordinates (for each country) into a polygon with matplotlib. Without using Basemap. Unfortunately, the parts are crossing or overlapping. Is there a workarund, maybe using the distance from point to point.. or reordering them ? 回答1: Ha! I found out, how.. I completely neglected, the sf.shapes[i]