Error - ERROR 1: Unable to find driver `‘ESRI'. while running ogr2ogr command - gdal

I have installed gdal
$ conda install -c esri gdal
And then tried to run the command to merge 2 shapefiles
$ ogr2ogr -f ‘ESRI Shapefile’ n4600e00800_30.tif_highlight-1.shp n4600e00900_30.tif_highlight-1.shp
but getting error
ERROR 1: Unable to find driver `‘ESRI'.
Not sure if the driver needs to be installed separately as couldn't find much on this error.

The ‘...’ quotes are the problem. Try double quotes: -f "ESRI Shapefile"
I'm not sure this is going to do what you expect. ogr2ogr converts between formats, it doesnt merge files. In your case it will results in a shapefile called n4600e00800_30.tif_highlight-1.shp that is identical to n4600e00900_30.tif_highlight-1.shp. Transformations between the same format are generally only useful if you add a filter, are changing coordinate reference system, etc.
What you are probably looking for is ogrmerge.py which should be callable from your CLI after installing GDAL. Your command should look like this then:
ogrmerge.py -o merged.shp n4600e00800_30.tif_highlight-1.shp n4600e00900_30.tif_highlight-1.shp
You can also add -f "ESRI Shapefile" to ensure that it writes to the correct format but it'll guess the format from the extension, .shp is a pretty safe bet that it'll get it right.

Related

SystemTap semantic error when trying to run dvorak-qwerty script

I found this repo with a systemtap script for letting me use QWERTY ctrl-shortcuts on my dvorak layout. Unfortunately, I can't get it to work, but I don't think it has to do with the script itself. I'm running Pop OS and I think that it's because the linux-image I need with all the debug symbols doesn't exist.
The script says I need to install linux-headers-$(uname -r) linux-image-$(uname -r)-dbg
For me, this turns into linux-headers-5.11.0-7620-generic linux-image-5.11.0-7620-generic-dbg
linux-headers-5.11.0-7620-generic exists and I'm able to download it using apt-get.
linux-image-5.11.0-7620-generic-dbg can't be installed using apt-get. I can install
linux-image-5.11.0-7620-generic, but that's not the same thing. I've spent time looking online for it and adding different keys to apt-get, but I haven't been able to find anything with that name. If the problem is not having the correct linux-image package installed, I need help being pointed in the right direction as to where I can get it.
I tried following the directions here, and I've also searched this to no avail. I tried downloading and installing linux-image-4.4.0-142-generic-dbgsym_4.4.0-142.168_amd64.ddeb but that also didn't work.
If this isn't the problem, I've provided the output of the script. Any help is appreciated.
peyton#pop-os:~/scripts$ sudo stap -g -v dvorak-qwerty.stp
Pass 1: parsed user script and 477 library scripts using 116428virt/91336res/7612shr/83628data kb, in 140usr/30sys/168real ms.
semantic error: resolution failed in DWARF builder
semantic error: resolution failed in DWARF builder
semantic error: while resolving probe point: identifier 'module' at dvorak-qwerty.stp:152:7
source: probe module("evdev").function("evdev_events") {
^
semantic error: no match
semantic error: resolution failed in DWARF builder
Pass 2: analyzed script: 2 probes, 0 functions, 1 embed, 0 globals using 119016virt/94812res/8680shr/86216data kb, in 10usr/0sys/7real ms.
Pass 2: analysis failed. [man error::pass2]
Tip: /usr/share/doc/systemtap/README.Debian should help you get started.
Yes, debuginfo downloading has been a pain on many distros. However, if you're running Debian kernels, see: https://wiki.debian.org/Debuginfod for instructions on using a new automated system. Generally: https://sourceware.org/elfutils/Debuginfod.html .

gdal_merge not recognized as internal or external command in OSGeo4W

I've just installed OSGeo4W and am trying to run gdal_merge from the OSGeo4W Shell from a directory other than C.
gdal_merge.py -o output.tif -a_nodata 0 1.tif 2.tif
I also tried: gdal_merge -o output.tif -a_nodata 0 1.tif 2.tif
I receive the following error:
gdal_merge is not recognized as an internal or external command.
I checked several directories in C:\OSGeo4W and I found gdal_merge.py is in C:\OSGeo4W\apps\Python37\Scripts. Do I need to duplicate the .py folder somewhere else? Thanks for your help. I thought gdal_merge should be included in the list of shell commands.
This is an issue I also ran into. It is apparently caused by OSGeo4W installing two Python Environments and in this case it defaults to setting up the wrong one.
You can fix the issue by first calling "py3_env".
This will set up the proper Python environment after which you can call gdal_merge.
Also see this thread dealing with approximately the same issue
I hope that helped!
Issue: gdal_merge.py: not found
Solution
apt install gdal-bin
Test it by simply typing gdal_merge.py on the terminal after installation and it'll show you how to use the utility.
Originally I posted my answer here: https://gis.stackexchange.com/a/449274/217765

Creating network files in SUMO using NETCONVERT

Problem when calling netconvert in sumo:
I am trying to create my own scenario for simulation purposes.
I am using OpenStreetMaps for this.
python osmWebWizard.py
opens the browser and I select the area which I download.
netconvert --osm-files osm_bbox.osm.xml -o osm.net.xml
The error message I get is
Error: Cannot import network data without PROJ-Library. Please install packages proj before building sumo
Warning: Environment variable SUMO_HOME is not set, using built in type maps.
Quitting (on error).
My attempt to fix the problem is:
sudo apt-get install libproj*
But it seems like a dead end there and I am out of options.
Thank you.
EDIT
I have a gut feeling it has to do with libproj0 not being available anymore.

mapnik configure fails during rpmbuild, but succeeds manually

I've posted this issue on the google groups area for mapnik already, so I'm just going to c/p from there:
I've been troubleshooting this issue for a couple days, now. Bear with me for context:
Starting from a freshly-untarred source of mapnik 2.2.0 on RHEL 6.5:
First off, running "./configure" (which just calls scons/scons.py) works great. Finishes correctly, then I run make + make install and I get exactly what I want built and installed.
My goal has been to create a mapnik 2.2.0 RPM for internal use. Please do not suggest using an "official" mapnik RPM instead (or any other already-built mapnik RPM), as my entire purpose here is to build mapnik from source and create my own RPM.
That being said, when my RPM gets to its %build phase and runs ./configure, it freezes while scons checks for freetype-config. I've let it sit for hours, and nothing happens.
After I looked at the generated config.log file, it would appear that configure is failing on an "awk" command that goes something like this:
awk '{print $\(NF-1\)}'
The command is performed on the string that results from the command:
/usr/bin/freetype-config --libs --cflags
I'm wondering, first of all, how to fix this, but second of all why this would work manually, but fail when the rpmbuild process gets to the ./configure command. I've made sure that the same user (myself) is running both ./configure commands on the exact same files.
My third question would be: why does the configure step freeze on this issue, instead of throwing some sort of error and stopping?
Note that the problem with the "awk" command is the backslashes--the error is:
awk: {print $\(NF-1\)}
^ backslash not last character on line
When I remove the backslashes, the command succeeds. Whether or not removing the backslashes is the correct thing to do in the long run, I do not know.
It would seem this is some sort of python string-parsing / encoding issue, but I'm unsure. What really confuses me is why this works manually and fails when the rpmbuild tries to do it.
My only thought is that there's some difference between the rpmbuild environment and my shell that I configured on. What it is, I do not know.
Thank you for any assistance you can provide. If I can provide any more context, please let me know.
UPDATE: an svn command runs after the awk failure, but is missing whatever number gets passed after the -r option. I'm wondering if this could be causing the hang...thoughts?

Multiple Job (j3)

I am trying to run a GNU make file with multiple jobs.
When I try executing ' make.exe -r -j3', the receive the following to errors:
make.exe: Do not specify -j or --jobs if sh.exe is not available.
make.exe: Resetting make for single job mode.
Do I have to add ' $(SH) -c' somewhere in the makefile? If so, where?
The error message suggests that make cannot find sh.exe. The file names indicate you are probably on CygWin. I would investigate setting the PATH to include the location of sh.exe, or defining the value of SHELL to the name (or, even, full path) of your shell.
Are you running this on Windows (more specifically, in the "windows" shell?). If you are, you might want to read this:
http://www.gnu.org/software/make/manual/make.html#Parallel
more specifically:
On MS-DOS, the ‘-j’ option has no effect, since that system doesn't support multi-processing.
Once again, assuming you're running on windows, you should get MinGW or CygWin