New answers tagged

0 votes

How to add/install library in python notebook or QGIS (python console)?

In your console example you have opened python and are trying to install the library. You'll need to install the library from outside of python. For QGIS it is easiest to do it from the OSGEO4W Shell ...
  • 3,010
1 vote

How to start reading shapefile in QGIS using python console?

Take a look at Using Vector Layers. For example: shapefile_path = r'/home/bera/Desktop/GIStest/buildings.shp' layer = QgsVectorLayer(shapefile_path, 'templayer') #Create a layer object all_features = [...
  • 55.3k
1 vote
Accepted

Create shapefile geometries from scratch using R

If you can plot anything on an R graphics window you can use the locator function to interactively draw points and lines. > plot(1:10) > xy = locator(type="l") Now click and draw ...
  • 53.8k
0 votes

Extract pixel values in raster stack using shp

I recommend you to use the exactextractr package instead of the extract function of the raster package which is extremely slow. Here is an example of how to use it: if (!require("raster")) ...
  • 479
0 votes

Fitting known size polygons into irregular polygons using ArcGIS Desktop?

Old but gold, there's a video on YouTube from 2020 showing how to do it interactively in QGIS. "QGIS how many circles contains a polygon" with circles... https://www.youtube.com/watch?v=zG-...
0 votes
Accepted

Clip several rasters with multipolygon and save them as separate rasters using R

That's the answer to the question above (i.e. using a multipolygon. In the answer section I posted an answer using separate polygons. #Load shapefile shape1 <- raster::shapefile("test.shp"...
  • 367
0 votes
Accepted

Geoserver Importer Plugin Error "java.io.IOException: Schema 'x' does not exist" - Ubuntu

The Problem was that I used german "ä ü ö" characters inside the features of the uploaded shapefiles. I had to reinstall geoserver.
0 votes

Using ogr2ogr to convert GML to shapefile in Python?

I found it simpler to use OGR CopyLayer which I found here. ds = ogr.GetDriverByName("GPKG").CreateDataSource(self.output_path) sf1 = ogr.Open(src_ds) sf_lyr1 = sf1.GetLayerByIndex(0) ds....
  • 645
2 votes
Accepted

Loading Shapefiles with addMapLayer() in PyQGIS does not display them until restart of QGIS

The QgisInterface.addVectorLayer() method, as well as returning a QgsVectorLayer object, also adds the layer to the project. So you are doing this twice using two different methods. I suggest changing:...
  • 15.8k
0 votes

Recover\rebuild the .dbf and .shx of a shapefile

As already mentioned the question is not clear. In particular, there are no details about how the source data was actually loaded into Oracle: My .shp files were extracted from a CSV file... That the ...
0 votes

Recover\rebuild the .dbf and .shx of a shapefile

I'm not sure I 100% understand the details of the system you are describing, however the main point that you are asking is: Do you know if there is any way to recover\rebuild the .dbf and .shx files ...
  • 2,953
0 votes
Accepted

R having trouble reading in shapefile

You might try ET_data <- st_read(file.path("C:/users/public/test3d.shp"))
  • 46
1 vote

How to deselect Shape Digitizing Toolbar in QGIS?

This caught me out at first too. Ensure the Advanced digitizing toolbar is visible (View > Toolbars > Advanced Digitizing Toolbar), then select Digitize with Segment in the dropdown.
  • 7,452
0 votes

What are the vectors inside a shapefile?

If you have read a shapefile into R using the sf package (eg using st_read) and the data are points, then you can get the coordinates using st_coordinates to return a two-column matrix. > head(...
  • 53.8k
5 votes
Accepted

Empty Geofabrik Shapefile data

Many of the shapefiles from that download are empty. The .shp files are 100 bytes long, which is basically just the shapefile header. There are large .shp files in that download but they don't have a ....
  • 53.8k
1 vote

Merging near lines with QGIS

All the mentioned tools can be found in Menu Processing > Toolbox: Create Line intersections: you get a point layer where the lines cross. Connect the points using Points to path. For order ...
  • 44.9k
2 votes

Exporting selected feature to shapefile in ArcGIS WebApp Builder on ArcGIS Portal under ArcGIS Enterprise

As far as I know, there is no out of the box widget that enables export of data from a Web App in ArcGIS Portal (Custom ones are available but you will need to customize obviously) The only capability ...
  • 2,953
1 vote

Data loss exporting shapefile to CSV in QGIS

After playing with options in the Save Vector Layer As... export menu, I closed the 'Select fields to export and their export options' drop-down menu, and then re-opened it. Somehow a previously ...
  • 179
1 vote

How to force close polygon to overlap/share the border

Using mapshaper and selecting on the option of "snap vertices", and then, in console, writing clean without further arguments, you get this st_difference(contry, cleaned_from_mapshaper) ...
  • 3,344
0 votes

Bulk file convertor QGIS plugin/program

I think the best option might be the installation of the HCMGIS plugin, which has a built-in batch converter. The plugin appears in the main top bar after installation. You can select: HCMGIS -> ...
  • 3,521

Top 50 recent answers are included