New answers tagged

1

The OpenStreetMap’s French community are maintaining a rather exhaustive and accurate set of maps. Whether you’re a cartographer, a graphic designer or a developer, they’ve made it easy to reuse their work. As a matter of fact, from the OpenStreetMap’s OSM format, they’ve exported the maps to various formats such as Shapefiles, SVG, GeoJSON (to mention a few ...


0

Create a unique ID field in the first column of the CSV file and populate it with a sequence (1,2,3...). Then load the CSV and join it to the shapefile. I've had Qgis display null values in the attribute table until I included an ID column to the data.


1

According to Shapefiles#Create_your_own_shapefiles there is at least one of the various osm2shp softwares written in C#, the osm2shp hosted at google code.


0

I am not sure which fields you are talking about, but it seems you are attempting to interpolate based on a field of joined table which is not in the original shapefile. To use interpolation on a shapefile there are many points you have to check: The fields should be embedded in the attribute table Field names should not exceed 10 characters in shapefile ...


1

No - there is no way to push just a dbf file to GeoServer. The easiest way to do it would be to open the file in OpenOffice or Excel and save it as CSV format. Then add the unsupported community csv-datastore to your GeoServer WEB-INF/lib folder.


5

These 255 rows represent 255 countries and each row is not a single polygon rather it is a multipolygon. Multiplogon for each country is due to the presence of large number of disjoint coastal areas or in other words islands. If you check the number of points involved in creating China alone, it goes beyond 7,00,000 reaching 11MB. You can check the size of ...


9

The dataset is so large, because the borders are very detailed. If you are looking for a worldwide overview, you better take the data from Natural Earth. They provide datasets suitable for different scales. http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/cultural/ne_10m_admin_0_countries.zip is the smallest one.


1

You read in the shapefile using a shapefile datastore and write out the KML using a KML datastore.


0

In the end we went with: https://developers.arcgis.com/android Here is sample code to get you started... private Boolean setBaseLayer() { File myShapeFilePath = null; try { if (MyApplication.mPathMaps == null || MyApplication.mPathMaps.length() < 1) { File rootDir = new File(Environment.getExternalStorageDirectory()....


1

It took me a bit to get this too. # shapefile path example: # C:/Users/User/GIS/MyShapefile.shp # OGR command: library(rgdal) readOGR("C:/Users/User/GIS", "MyShapefile") You have to leave off the ".shp" extension as well as the last forward slash on the path.


1

Open as a text file layer (comma button on the right side panel) Set X,Y axis as long, lat Right click on the layer save as Set coordinate system CRS to WGS84 Set format to ESRI Shape file


1

In this case, it is preferable to use itertools module to avoid repeated indexes. I assumed one feature for each shapefile in next situation: Next code prints all the names of the shapefiles that overlap with each other. import itertools mapcanvas = iface.mapCanvas() layers = mapcanvas.layers() feats = [] for layer in layers: for feat in layer....


5

You are ahead of yourself, review the Guidelines and make sure you succeeded in all of the steps. Before you have gotten discussion on the imports mailing list there should be no thoughts wasted on data wrangling. The data structure of OSM itself is explained in http://wiki.openstreetmap.org/wiki/Map_Features You will need to invest considerable amounts of ...


2

When you are computing distance (I'm guessing using a buffer tool given the concentric color zones), under Environments, expand Processing Extent and set the Extent to your Polygon file.


1

It seems that 'shp2pgsql-gui' is now part of the postgis-gui package Try : sudo apt-get install postgis-gui It worked for me.


1

If the service is registered with OpenData, the service's OpenData page will allow you to download the data in a variety of different formats including Shapefiles. Another way to do this would be to query all the features and save the resulting JSON (see sample JavaScript code), then use the JSON to Features geoprocessing tool tool to create a feature class....


0

whatever type of vector layer you are using you can add this function in OpenLayers 3 to fit your map extent to the layer one: var extent=yourVectorSource.getFeatures()[0].getGeometry().getExtent(); yourVectorSource.forEachFeature(function(feature){ ol.extent.extend(extent,feature.getGeometry().getExtent())}); yourMap.getView().fit(extent, yourMap.getSize())...


0

My suggestion is look at the sample code the is in the SharpMap solution. Source code: older on CodePlex https://sharpmap.codeplex.com/ Current Fork on GitHub https://github.com/SharpMap/SharpMap It was pretty easy to get to compile using VS2013 or VS2015. Open SharpMap.sln Take a look at Examples\WinFormSamples and Examples\DemoWinForm projects A ...


0

My experience is that Mac is not working properly when combining vector with raster data. Raster calculations is not a problem but vector and raster is an issue. Sometimes it simply takes a lot of time and calculations are done. In other cases it does not work.


3

This would not be fire frequency because, if it is point data, it would either be an ignition event or an area (polygon) generalized into a point location. Thus it would aptly be ignition frequency or a misrepresentation of a fire process. Inherently, fires occur across space and as such are associated with area and not discrete point location(s). Sorry ...


0

If you are simply looking to assign the raster value based on the number of points in a cell, the tool you'll use is 'Point to raster' in Conversion Tools->To Raster. For the 'Cell assignment type' you will select Count. If you points hold counts or some sort of other attribute you need to sum, then select the appropriate operator from the menu and the ...


4

From the menubar, go to: Settings > Options > Digitizing > Feature creation and disable the Reuse last entered attribute values setting: (I'm sure this was asked before but can't find the post.)


0

I have just now developed a fairly full featured program that simplifies kml files. As well as gpx and tcx ones. It supports a number of techniques that make the file smaller, many are essentially loss-less, others reduce the precision of the path.


0

Maybe you can use DNRGPS to do the conversion. I usually use this for tracklogs and other raw data types in gpx format.


1

Based on your question, I would do several extract by attributes and then merge the extracted together. This can be done in one and the same moddel. But to be sure, you have to be more specific about what algorithms you are using to break them down.


0

You can have a look at the OSM wiki about Shapefiles and Converting_map_data_between_formats to get all known tools for converting shapefiles into raw OSM XML format or compressed binary PBF files.


2

I would try to filter by Geometry Type during each conversion. For example, only Lines should be forced into the Line shapefile. I think your examples are Casting Lines to Polygons and Polygons to Lines. The geometry filter should prevent this from happening. Please see the OGR_GEOMETRY example in the OGR_SQL help. http://www.gdal.org/ogr_sql.html


2

The answer provided by @UjeIndo seems to be the correct one although I am also unsure how to exactly use the Creation Options. But if you have loaded your shapefiles into QGIS, you could loop through each one and save it as a .kml file specifying the datasourceOptions by using the following in the Python Console: result_path = "path/to/directory/" for layer ...


0

There is a built-in function for this in the QGIS API. Select your layer in the Layers panel, then open the Python console and run the following: from qgis.core import QgsVectorFileWriter layer = iface.activeLayer() # If no layer selected, it will be empty and make the end of the script failed shp_path = layer.dataProvider().dataSourceUri().split('|')[0] ...


3

Yes, there is. its called "Convert format". Go to processing toolbox and run it from there by right click then run as batch processing. UPDATE : put as follow in creation option column: -dsco AltitudeMode=absolute -dsco NameField=Name -dsco DescriptionField=Description For example, in my case will be -dsco AltitudeMode=clampToGround -dsco ...


2

First of all, if you want to work with heights, normalize the LiDAR point cloud. You have a dense point cloud (4 pts/m²) and also high resolution aerial photos, hence, as you said getting the outside roof perimeter is not an issue. Therefore, assuming you'll manage to have a shapefile with the outer roof boundaries, use it to horizontally clip the point ...


0

You can the this link too. Here CSV files are being converted to either KML or Shapefile using js2shapefile. You can check the source code how it works. This is a working example.


2

This is not a bug but an expected behavior. Note that rasterize takes a fun argument that handles grid cells with two or more values. By default it uses that last function, namely the value that appears last on the data data.frame is used. Similarly first will use the value that appears first. Other functions include count, mean, etc. Here is a short ...


1

Since this is a "large" file your best bet is to style it on the server and use the WMS service to send it to your browser as a small image (i.e. a compressed png). GeoServer uses SLD to style layers, there are many examples available in the SLD cookbook which you can use as a basis for your style. In your case I would recommend using the recode function as ...


1

You can do library(raster) x <- shapefile('file.shp') crs(x) x$area_sqkm <- area(x) / 1000000 Assuming that your crs is longitude/latitude, or with meter as distance unit


2

That is a trivial task with gdal: ogr2ogr -t_srs EPSG:3857 destination.shp source.shp See http://www.gdal.org/ogr2ogr.html for more information. There might be ruby bindings for this, I have no idea. EPSG:3857 coordinates are not lat/long though, if you really need those, just use EPSG:4326.


0

In layout mode, hold ctrl+shift+b then use left-click to zoom in or out (left-click-hold+drag cursor) or right-click to pan (right-click-hold+drag cursor). It's a long reach for the fingers, but is really nice for layout adjustments.


5

In your Table of Contents (the list of layers usually found on the left side of your ArcMap window), right-click on your US border shapefile and click "Zoom to Layer". That will zoom to the extents of the layer and center your view on the layer. FYI, you can also zoom to one (or several) features in the layer, instead of the entire layer. To do that, open ...


1

If you center your map in data view, layout view should show the same extent.


2

FROM should contain table names, not column names (and 100 is missing here in the table name) The ON part should connect columns from both tables, but you have specified the same table on both sides. I suggest to put the whole sql statement in quotation marks, single ones for Linux and double for Windows. The roles of dst_datasource_name and ...


2

You need to use the -dstalpha option to gdalwarp e.g.: gdalwarp -cutline INPUT.shp -crop_to_cutline -dstalpha INPUT.tif OUTPUT.tif This will add an alpha band to the output tiff which masks out the area falling outside the cutline. P.S. duplicate question



Top 50 recent answers are included