Could someone tell me how to create a shape file (to use in GIS software) from a tmap object created in R?
I have something like this:
Map <- tm_shape (raster) + tm_raster() + tm_shape(shape) + tm_borders()
I know that tmap_save allows me to save the Map object in various formats but raster and SHP.
I would like to save Map as a SHP file so that it can be made available for use in GIS software.
Related
I have a DEM file with XYZ points (file sample image), and I want to use it to create terrain in Cesium with it. I tried to translate it to GeoTiff by ArcMap, but it is not supported by cesium terrain builder.
How could I create terrain files with points in Cesium?
Cesium is able to consume Quantized Mesh tiles but not GTIFF or XYZ directly.
First, you will have to convert your XYZ file to e.g. GTIFF and transform it to WGS84 coordinate reference system. Both can be done using gdal.
Second, convert your transformed GTIFF files to quantized-mesh format.
I created a Docker image for that purpose. Check out the Github page of tumgis/cesium-terrain-builder-docker for a detailed documentation of the entire process.
Finally, you will need a service like CesiumTerrainServer to serve the tiles to a Cesium application.
The format of the map imported should be preferably ".shp" file.Also please tell how to create such a file. I have tried KML but it didn't work.
Yes, vectors need to be .shp to be imported. You can create vector files in most GIS programs (ArcGIS, QGIS, etc) and export to .shp. Or there's online tools for converting KML to .shp (eg http://www.zonums.com/online/kml2shp.php)
Raster files need to be saved as .ASC or .GRD for use as a dataset in Netlogo.
I'm trying to add data in json format to a geojson file. I realise that one way of doing this, is to transform the geojson file into a shape file, the data in an R object, and merge the two, as attempted here. However, I was wondering whether this is possible without switching 'back' to a shape file. Here's the code to obtain the geojson file and data file:
library(leafletR)
library(jsonlite)
# obtaining map
download.file("http://node-128.dev.socialhistoryservices.org/api/maps?year=1937",
destfile = paste0("testmap", ".json"))
map <- leaflet("./testmap.json")
map # displays map in browser
# obtaining data
testdata <-
fromJSON("http://node-128.dev.socialhistoryservices.org/api/data?code=TXCU")
Note: the 'key' in both files is 'amsterdam_code'
In case you are using node.js try extend-geojson-properties and if want to use on client side download index.js file from github project. See how to use in README of the project.
You can convert topojson to geojson features using topojson api. Then create a join map between geojson and json with common id.
I used Mike Bostock's great tutorial to make a simple map using downloaded shapefiles and processing them with GDAL into GeoJSON files.
http://bost.ocks.org/mike/map/
I'm trying to build on this learning by taking a county-level shapefile map and marrying it with additional demographic data (CSV) so that I can load a single GeoJSON file and not have to use Javascript to merge the data at runtime. The goal is to have a county-level heatmap.
The CSV file has an ID column that looks like this: 01348. While the Shapefile has two ID columns that are 01 and 348.
Is it possible to use GeoJSON to store this kind of data? If so, what kind of terminal commands must I use to combine the two?
Little trick:
When converting from Shape file to GeoJSON, keep "id-a":"01";"id-b":"348" as neighbors in this order.
use a simple regex to delete all ";"id-b":" and thus obtain "id-a":"01348".
go ahead to inject your CSV property given the common ID, see: How to add properties to topojson file?
That's should work.
I want to mark some locations in a vector map. And would like to save the map in pdf format with separate layers.I tried arcgis but the map is online cannot export it to a file. can i know what is the common and standerd way of representing data using a vecotr map
Try this vector maps first, they have free versions, it can be useful:[http://vectormap.info/free-maps-for-all-designers-and-mappers][1] it could be easier for you too