New answers tagged

0

Turns out, it's not really a multipoint feature. While one can't read the file with readOGR, it works with st_read from the sf package. From there it's possible to transform the object into a SpatialMultiPoints object (shape_points below). But looking at the features one sees that they're actually just simple points, not multipoints. The following command ...


1

No - the templating in ogrmerge.py looks to do a simple replacement and I don't see a way to put any more logic into it. A rewrite of chunks of ogrmerge.py would be necessary to extend the syntax to something like {DS_BASENAME:1:9}. I think the easiest way would be use ogrmerge and then post-process it to fix the fields you want to change (with some python ...


2

The problem seems to be the point data's shapefile rather than the functions that seem to work with polygons and not points. You should check with the publisher of your data. I was not even able to load the point data in R. Instead, by exporting the shapefile as .csv in QGIS and loading it in R (get the csv here) as a multipoint feature, one would get: ...


1

You have a projection problem. The shapefile has a coordinate reference system (CRS) that is used as the units of measure in the geometry, and defined in the files PRJ. These need to match. I suspect that you have added your data to QGIS. Then you went into properties-source and changed the CRS to WGS84. Below is a screen shot of some data using EPSG ...


1

Try Integrate (backup data first), but that will affect all your lines, not only the ones Close together: Integrate is used to maintain the integrity of shared feature boundaries by making features coincident if they fall within the specified x,y tolerance. Features that fall within the specified x,y tolerance are considered identical or coincident. ...


0

I have one logic I think will work to solve the problem. First define the distance which you think it is too close. Distance=too close distance Then use Spatial Query (Feature Within) give distance and delete the selected data.


0

Not really an answer but that's what I will do to diagnose such an error : Verify the geometry and repair any error you find. (See this for zoom related disappearing polygon) Made sure it's not a display issue (transparent symbol or no symbology) (Like @Steve said in his answer) Check that there are no provider feature filter set (but if there are some you ...


0

As mentioned by Spacedman, it is much easier to address your issue with reproducible data. To make sure you address both the possible concern of emptiness and not matching CODIGO_MUN, I would try library(raster) # make sure next time that you specify which libraries you are using, I am assuming these suffice library(rgdal) all.mun <- NULL for (j in ...


1

With the release of QGIS 3.8 there is new feature to generate raster MBTiles layers. Once the layer you want to convert is setup, you can open up the Toolbox by either selecting the gear icon or by going into the processing tab on the menu bar and selecting toolbox. Then in the Processing Toolbox, drill-down into the Raster Tools section. Within this ...


1

In GDAL 3.1+ you can create zipped shapefiles, although not using vsizip (as far as I've tested). See docs page Starting with GDAL 3.1, the driver can also support reading, creating and editing .shz files (ZIP files containing the .shp, .shx, .dbf and other side-car files of a single layer) and .shp.zip files (ZIP files contains one or several ...


0

On possible issue is that -tr specifies the resolution in the unit of the input's CRS, so if the input is in EPSG:4326 then -tr 1 1 will produce a raster where each pixel correspond to 1 degree of latitude/longitude, which is most likely not what you want. In your case you specified -tr 30 30. If the CRS of the shapefile has unit of meter and your feature ...


0

I once generated a partial EPANet input file from a pipes layer in MapInfo so I understand a bit about what you need. Pipes are defined in one section of the input file with the data: length, diameter, unique pipe id, start node and end node. The nodes (called junctions) are defined in another section of the input file with the data: elevation, demand and ...


5

Either choose a different file format or partition the raster into smaller pieces until each one produces a shapefile which weighs less than 4GB. You can partition the raster automatically by selecting the "Create VRT" checkbox at the top and specifiying the tile sizes in the section that appears (see pic) In my personal opinion, however, it is better to ...


0

The shapefile can be found here: http://thematicmapping.org/downloads/world_borders.php


1

Here is a link to an up to date (Sep 2019) file I created myself: https://8n1.org/raw/15893/4597 Mirror: https://paste.ubuntu.com/p/vHbV2MTWfd/


3

From a quick look at the ShapeFile reading code it appears that GeoTools just reads the M value and throws it away. So it looks like what you are trying to do is impossible. I haven't tested it but if you change line 89 to cs.setOrdinate(0, CoordinateSequence.M, buffer.getDouble()); it should work. If you test this and it does work please make a PR for ...


2

I am not sure if this is the issue, but when exporting to KML make sure to write the field name that represent the labels in the NameField as you can see below. Here is the result If you write another field name, it will be loaded automatically into GoogleEarth Here is the result


1

The plot() method returns an AxesSubplot object which you are storing as ax. This object has various methods and properties (as you figured out by calling ax.scatter()) but is is not callable itself; this means you can't run ax(). To get the x and y coordinates, remove that call from the following line: x, y = ax(df2['lon'].values, df2['lat'].values) so it ...


2

I don't use QGIS to import data but let me give you a working solution if you are able to use ogr2ogr. ogr2ogr -f "PostgreSQL" "PG:host=serverhost user=username dbname=dbname password=password" yourshpfile.shp -lco GEOMETRY_NAME=the_geom -lco FID=gid -lco PRECISION=no -nlt PROMOTE_TO_MULTI -nln tablename -t_srs "EPSG:4326" Add your own credentials and set ...


1

Using a Coordinate object throws an exception if you're trying to set its M value: Coordinate c = new Coordinate(i*10,i*5,i); c.setM(i*20); Point p = geometryFactory.createPoint(c); Exception in thread "main" java.lang.IllegalArgumentException: Invalid ordinate index: 3 This is because the normal Coordinate hasn't got an actual "m" value (so it would be ...


3

QGIS has a longstanding issue with slow attribute table loading for large layers. The entire attribute table pre-loads before you can see attributes for a subset of your features. It's a problem. The devs are working on it. Apparently it's more difficult to fix than you might imagine; you can read about it here and here. In the meantime, you can work ...


0

After you press the pencil button you can edit your shapefile layer. After editing you just press it again and if you made any edits it should ask you to save the changes. You have to select the layer in the layers panel to be able to press the pencil.


0

By adding file iterator and according to these steps and pnj attached you can do it. 1- file iterator 2 insert from KMLto layer tool 3 connect outputs of file iterator (file and name ) to "KMLto layer tool" 4- specify only output folder in KMLto layer tool


0

As I wrote in this answer, a native PHP alternative to using evil eval() and shp2pgsql utility would be my PHP Shapefile library, that can read and write any ESRI Shapefile natively in PHP. It is a free, open source, native PHP library, does not require any third party dependency and is actively maintained.


0

An alternative to using evil eval() would be my PHP Shapefile library, that can read and write any ESRI Shapefile natively in PHP. I (and many others, actually) have been using it for this very same scope, loading tons of Shapefiles into PostgreSQL, thanks to the WKT output provided by the library and PostGIS ST_GeomFromText() function. It is a free, open ...


3

You can create separate polygons in KML format directly when using the Convert format tool without using other tools as follows and using an example: This is a grid shapefile with 20 polygons Use Convert format tool from Processing toolbox -> GDAL -> Vector Conversion -> Convert format Select Input Polygon shapefile (20 polygons above in this ...


4

How to split a vector layer and convert it to KML format The split vector layer tool creates geopackage files by default. If this is a process you do frequently, it may be worthwhile to follow the steps here to change the output setting for this tool. Otherwise, it takes two steps to split your layer and convert it to KML. Split the layer using the split ...


5

As per the comment, you need to choose the format you want to convert to by choosing the Save to file option in the 'Converted section, and then picking the format you want to convert to. You need to end up with a GDAL command that begins with ogr2ogr -f "LIBKML" You have to do this because the default option for this tool as per the documentation is ...


2

Here is a solution that I think will work for you: Go to Plugins and install the mmqgis-plugin Use the plugins' combine function to merge your layers. Save/export the combined layer as KML.


2

Here is how I made the file for you: Got tabular data with country names, currency, and currency code from github here: https://gist.github.com/HarishChaudhari/4680482#file-country-code-to-currency-code-mapping-csv Downloaded country layer from ESRI here:https://hub.arcgis.com/datasets/a21fdb46d23e4ef896f31475217cbb08_1 Change ESRI .dbf table to .csv table, ...


0

Ordnance Survey (Great Britain not UK) has OS Master Map with a new layer descriptions. "OS MasterMap Topography Layer's Descriptive terms will update over 11 million features across land, rivers, water and structures." This includes natural and man-made structures There is a excel spreadsheet that list all of the layers available to view the layers ...


0

So I found a better solution with less code. All I had to do was use the ms_simplify function from the rmapshaper package after using the gSimplify function. The shapes load super fast now. library(sp) library(rgeos) library(readr) library(raster) library(leaflet) library(rmapshaper) AUS <- getData("GADM", country = "AUS", level = 1) CAN <- getData("...


2

Let's make a reproducible example... First use the raster::getData package to get a raster of the heights of Liechtenstein (because Liechtenstein is quite small so we can see what its doing, and also because I played in a band that had a number 3 hit in the country...): > library(raster) > library(sp) > raster1 = getData('alt', country='LIE', mask=...


0

Try using this command: ogr2ogr -clipsrc B.shp out.shp A.shp -clipsrclayer B


0

Try this, ogr2ogr -f "ESRI Shapefile" out.shp road.shp -dialect sqlite -sql "select ST_Diffrence(road.geometry, seg_buff.geometry) from road, 'seg_buff.shp'.seg_buff seg_buff Put an extra seg_buff at the end


1

If your destination is an ESRI geodatabase (enterprise geodatabase or file geodatabase). Use the "Feature Class to Feature Class" tool, or the "Copy Features" tool. For more information (including the difference between the two tools) see: Difference between Copy Features and Feature Class to Feature Class tools? OR, if you only want the attributes, and ...


Top 50 recent answers are included