imposm stops during import - openstreetmap

I am trying to develop an application where I want to include openstreetmaps. I decided to try mapbox for this.
I am trying to import data from a osm.pbf file. I have a multiprocessor system capabable of doing a lot of work but in the middle of the import it just seem to stop working. Do I just have to wait or is there an error?
ubuntu#ip-xx-xx-xx-xx:~/Documents/mapbox-osm-bright-5f237ac/shp$ sudo imposm -U postgres -d osm -m /home/ubuntu/Documents/mapbox-osm-bright-5f237ac/imposm-mapping.py --read --write --optimize --concurrency 10 --cache-dir /mnt/cache --overwrite-cache --deploy-production-tables /mnt/cc/sweden-latest.osm.pbf
loading /home/ubuntu/Documents/mapbox-osm-bright-5f237ac/imposm-mapping.py as mapping
password for postgres at localhost:
[11:30:54] ## reading /mnt/cc/sweden-latest.osm.pbf
[11:30:54] coords: 17545k nodes: 350k ways: 2506k relations: 17k (estimated)
[11:32:02] coords: 26272k nodes: 101k ways: 28k relations: 0k
Then I press Ctrl-C after a long time
^CProcess CacheWriterProcess-3:: 101k ways: 28k relations: 0k
Process CacheWriterProcess-5:
Traceback (most recent call last):
Traceback (most recent call last):
File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
Process ParserProgress-1:
Traceback (most recent call last):
self.run()
self.run()
File "/usr/local/lib/python2.7/dist-packages/imposm/reader.py", line 123, in run
File "/usr/local/lib/python2.7/dist-packages/imposm/reader.py", line 123, in run
File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
data = self.queue.get()
data = self.queue.get()
File "/usr/lib/python2.7/multiprocessing/queues.py", line 117, in get
File "/usr/lib/python2.7/multiprocessing/queues.py", line 117, in get
res = self._recv()
res = self._recv()
KeyboardInterrupt
KeyboardInterrupt
self.run()
File "/usr/local/lib/python2.7/dist-packages/imposm/util/__init__.py", line 54, in run
log_statement = self.queue.get()
File "/usr/lib/python2.7/multiprocessing/queues.py", line 117, in get
Process CacheWriterProcess-2:
Traceback (most recent call last):
File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
res = self._recv()
KeyboardInterrupt
self.run()
File "/usr/local/lib/python2.7/dist-packages/imposm/reader.py", line 123, in run
data = self.queue.get()
File "/usr/lib/python2.7/multiprocessing/queues.py", line 117, in get
res = self._recv()
KeyboardInterrupt
Process CacheWriterProcess-4:
Traceback (most recent call last):
File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
self.run()
File "/usr/local/lib/python2.7/dist-packages/imposm/reader.py", line 123, in run
Traceback (most recent call last):
File "/usr/local/bin/imposm", line 9, in <module>
data = self.queue.get()
File "/usr/lib/python2.7/multiprocessing/queues.py", line 117, in get
load_entry_point('imposm==2.5.0', 'console_scripts', 'imposm')()
File "/usr/local/lib/python2.7/dist-packages/imposm/app.py", line 253, in main
res = self._recv()
KeyboardInterrupt
reader.read(arg)
File "/usr/local/lib/python2.7/dist-packages/imposm/reader.py", line 88, in read
parser.parse(filename)
File "/usr/local/lib/python2.7/dist-packages/imposm/parser/simple.py", line 62, in parse
return self.parse_pbf_file(filename)
File "/usr/local/lib/python2.7/dist-packages/imposm/parser/simple.py", line 73, in parse_pbf_file
return self._parse(filename, PBFMultiProcParser)
File "/usr/local/lib/python2.7/dist-packages/imposm/parser/simple.py", line 140, in _parse
time.sleep(0.001)
KeyboardInterrupt
Process Process-6:
Traceback (most recent call last):
File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
self.run()
File "/usr/lib/python2.7/multiprocessing/process.py", line 114, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python2.7/dist-packages/imposm/parser/simple.py", line 113, in parse_it
parser.parse(input)
File "/usr/local/lib/python2.7/dist-packages/imposm/parser/pbf/multiproc.py", line 70, in parse
pos_queue.put(pos)
File "/usr/lib/python2.7/multiprocessing/queues.py", line 311, in put
if not self._sem.acquire(block, timeout):
KeyboardInterrupt
Now just working 2-3% and never seem to finnish, any ideas?

This is because of a bug in imposm. To install a patch to fix it:
pip install https://github.com/omniscale/imposm-parser/tarball/master

It can be circumvented by downloading the unpackaged OSM-XML file.
Imposm has a problem reading the PBF format on certain occasions. But the unpackaged OSM-XML file does the trick.
In denmark, it is pbf-file (166 MB) vs. osm-xml-file (261 MB, 4.4 GB, decompressed)
root#drake:/mnt/disk/maps# imposm -U postgres -d osm -m /usr/local/share/maps/style/osm-bright-master/imposm-mapping.py --cache-dir cache --read --write --optimize --deploy-production-tables denmark-latest.osm --overwrite-cache
Enabling Shapely speedups.
loading /usr/local/share/maps/style/osm-bright-master/imposm-mapping.py as mapping
[14:53:01] ## reading denmark-latest.osm
[14:53:01] coords: 22391k nodes: 447k ways: 3198k relations: 22k (estimated)
[14:58:38] coords: 15171k nodes: 33k ways: 1587k relations: 6k
[14:58:39] reading took 5 m 37s
[14:58:39] ## dropping/creating tables
[14:58:39] ## writing data
[14:58:47] relations: 6k/6k
[14:58:51] relations: total time 12s for 6783 (562/s)
[15:08:18] ways: 1587k/1587k
[15:08:19] ways: total time 9 m 28s for 1587006 (2793/s)
[15:08:27] nodes: 32k/33k
[15:08:28] nodes: total time 8 s for 33279 (3805/s)
[15:08:28] ## creating generalized tables
[15:08:57] generalizing tables took 28s
[15:08:57] ## creating union views
[15:08:57] creating views took 0 s
[15:08:57] ## creating geometry indexes
[15:09:18] creating indexes took 21s
[15:09:18] writing took 10m 39s
[15:09:18] ## optimizing tables
Clustering table osm_new_mainroads
Clustering table osm_new_buildings
Clustering table osm_new_mainroads_gen1
Clustering table osm_new_mainroads_gen0
Clustering table osm_new_amenities
Clustering table osm_new_waterareas_gen1
Clustering table osm_new_waterareas_gen0
Clustering table osm_new_motorways_gen0
Clustering table osm_new_aeroways
Clustering table osm_new_motorways
Clustering table osm_new_transport_points
Clustering table osm_new_railways_gen0
Clustering table osm_new_railways_gen1
Clustering table osm_new_landusages
Clustering table osm_new_waterways
Clustering table osm_new_railways
Clustering table osm_new_motorways_gen1
Clustering table osm_new_waterareas
Clustering table osm_new_places
Clustering table osm_new_admin
Clustering table osm_new_barrierways
Clustering table osm_new_minorroads
Clustering table osm_new_barrierpoints
Clustering table osm_new_landusages_gen1
Clustering table osm_new_landusages_gen0
Vacuum analyze
[15:09:53] optimizing took 35s
[15:09:53] imposm took 16m 52s

Related

Exporting trained instrument in DDSP-VST

I bought the pro colab+ and uploaded my own instrument to google drive and I initiated the training module and after 30 mins it is finished but gives me an error saying that the instrument is not found.
this is the error code :
Exporting model...
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/ddsp/training/train_util.py", line 165, in get_latest_operative_config
restore_dir, prefix='operative_config-', suffix='.gin')
File "/usr/local/lib/python3.7/dist-packages/ddsp/training/train_util.py", line 106, in get_latest_file
f'No files found matching the pattern '{search_pattern}'.')
FileNotFoundError: No files found matching the pattern '/content/gdrive/MyDrive/My/operative_config-*.gin'.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/bin/ddsp_export", line 8, in
sys.exit(console_entry_point())
File "/usr/local/lib/python3.7/dist-packages/ddsp/training/ddsp_export.py", line 364, in console_entry_point
app.run(main)
File "/usr/local/lib/python3.7/dist-packages/absl/app.py", line 312, in run
_run_main(main, args)
File "/usr/local/lib/python3.7/dist-packages/absl/app.py", line 258, in _run_main
sys.exit(main(argv))
File "/usr/local/lib/python3.7/dist-packages/ddsp/training/ddsp_export.py", line 333, in main
export_impulse_response(model_path, save_dir, FLAGS.reverb_sample_rate)
File "/usr/local/lib/python3.7/dist-packages/ddsp/training/ddsp_export.py", line 272, in export_impulse_response
ddsp.training.inference.parse_operative_config(model_path)
File "/usr/local/lib/python3.7/dist-packages/ddsp/training/inference.py", line 41, in parse_operative_config
operative_config = train_util.get_latest_operative_config(ckpt_dir)
File "/usr/local/lib/python3.7/dist-packages/ddsp/training/train_util.py", line 168, in get_latest_operative_config
os.path.dirname(restore_dir), prefix='operative_config-', suffix='.gin')
File "/usr/local/lib/python3.7/dist-packages/ddsp/training/train_util.py", line 106, in get_latest_file
f'No files found matching the pattern '{search_pattern}'.')
FileNotFoundError: No files found matching the pattern '/content/gdrive/MyDrive/operative_config-*.gin'.
Export complete! Zipping /content/gdrive/MyDrive/My Instrument/ddsp-training-2022-07-18-0955/My_Instrument to /content/gdrive/MyDrive/My Instrument/ddsp-training-2022-07-18-0955/My_Instrument.zip
/bin/bash: line 0: cd: too many arguments
Zipping Complete! Downloading... My_Instrument.zip
You can also find your model at /content/gdrive/MyDrive/My Instrument/ddsp-training-2022-07-18-0955/My_Instrument
FileNotFoundError Traceback (most recent call last)
/usr/local/lib/python3.7/dist-packages/ipyfilechooser/filechooser.py in _on_select_click(self, _b)
315 if self._callback is not None:
316 try:
--> 317 self._callback(self)
318 except TypeError:
319 # Support previous behaviour of not passing self
3 frames
/usr/local/lib/python3.7/dist-packages/google/colab/files.py in download(filename)
187 raise OSError(msg)
188 else:
--> 189 raise FileNotFoundError(msg) # pylint: disable=undefined-variable
190
191 comm_manager = _IPython.get_ipython().kernel.comm_manager
FileNotFoundError: Cannot find file: /content/gdrive/MyDrive/My Instrument/ddsp-training-2022-07-18-0955/My_Instrument.zip

Failing to install pandas due to an error

I am Failing to install pandas in cmd using pip-install pandas due to the error below that pops up when installing. I am using python version 3.7
Traceback (most recent call last):
File "c:\users\chiya\appdata\local\programs\python\python37-32\lib\site-packages\pip\_vendor\urllib3\response.py", line 360, in _error_catcher
yield
File "c:\users\chiya\appdata\local\programs\python\python37-32\lib\site-packages\pip\_vendor\urllib3\response.py", line 442, in read
data = self._fp.read(amt)
File "c:\users\chiya\appdata\local\programs\python\python37-32\lib\site-packages\pip\_vendor\cachecontrol\filewrapper.py", line 62, in read
data = self.__fp.read(amt)
File "c:\users\chiya\appdata\local\programs\python\python37-32\lib\http\client.py", line 447, in read
n = self.readinto(b)
File "c:\users\chiya\appdata\local\programs\python\python37-32\lib\http\client.py", line 491, in readinto
n = self.fp.readinto(b)
File "c:\users\chiya\appdata\local\programs\python\python37-32\lib\socket.py", line 589, in readinto
return self._sock.recv_into(b)
File "c:\users\chiya\appdata\local\programs\python\python37-32\lib\ssl.py", line 1052, in recv_into
return self.read(nbytes, buffer)
File "c:\users\chiya\appdata\local\programs\python\python37-32\lib\ssl.py", line 911, in read
return self._sslobj.read(len, buffer)
socket.timeout: The read operation timed out.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\users\chiya\appdata\local\programs\python\python37-32\lib\site-packages\pip\_internal\cli\base_command.py", line 179, in main
status = self.run(options, args)
File "c:\users\chiya\appdata\local\programs\python\python37-32\lib\site-packages\pip\_internal\commands\install.py", line 315, in run
resolver.resolve(requirement_set)
File "c:\users\chiya\appdata\local\programs\python\python37-32\lib\site-packages\pip\_internal\resolve.py", line 131, in resolve
self._resolve_one(requirement_set, req)
File "c:\users\chiya\appdata\local\programs\python\python37-32\lib\site-packages\pip\_internal\resolve.py", line 294, in _resolve_one
abstract_dist = self._get_abstract_dist_for(req_to_install)
File "c:\users\chiya\appdata\local\programs\python\python37-32\lib\site-packages\pip\_internal\resolve.py", line 242, in _get_abstract_dist_for
self.require_hashes
File "c:\users\chiya\appdata\local\programs\python\python37-32\lib\site-packages\pip\_internal\operations\prepare.py", line 334, in prepare_linked_requirement
progress_bar=self.progress_bar
File "c:\users\chiya\appdata\local\programs\python\python37-32\lib\site-packages\pip\_internal\download.py", line 878, in unpack_url
progress_bar=progress_bar
File "c:\users\chiya\appdata\local\programs\python\python37-32\lib\site-packages\pip\_internal\download.py", line 702, in unpack_http_url
progress_bar)
File "c:\users\chiya\appdata\local\programs\python\python37-32\lib\site-packages\pip\_internal\download.py", line 946, in _download_http_url
_download_url(resp, link, content_file, hashes, progress_bar)
File "c:\users\chiya\appdata\local\programs\python\python37-32\lib\site-packages\pip\_internal\download.py", line 639, in _download_url
hashes.check_against_chunks(downloaded_chunks)
File "c:\users\chiya\appdata\local\programs\python\python37-32\lib\site-packages\pip\_internal\utils\hashes.py", line 62, in check_against_chunks
for chunk in chunks:
File "c:\users\chiya\appdata\local\programs\python\python37-32\lib\site-packages\pip\_internal\download.py", line 607, in written_chunks
for chunk in chunks:
File "c:\users\chiya\appdata\local\programs\python\python37-32\lib\site-packages\pip\_internal\utils\ui.py", line 159, in iter
for x in it:
File "c:\users\chiya\appdata\local\programs\python\python37-32\lib\site-packages\pip\_internal\download.py", line 596, in resp_read
decode_content=False):
File "c:\users\chiya\appdata\local\programs\python\python37-32\lib\site-packages\pip\_vendor\urllib3\response.py", line 494, in stream
data = self.read(amt=amt, decode_content=decode_content)
File "c:\users\chiya\appdata\local\programs\python\python37-32\lib\site-packages\pip\_vendor\urllib3\response.py", line 459, in read
raise IncompleteRead(self._fp_bytes_read, self.length_remaining)
File "c:\users\chiya\appdata\local\programs\python\python37-32\lib\contextlib.py", line 130, in __exit__
self.gen.throw(type, value, traceback)
File "c:\users\chiya\appdata\local\programs\python\python37-32\lib\site-packages\pip\_vendor\urllib3\response.py", line 365, in _error_catcher
raise ReadTimeoutError(self._pool, None, 'Read timed out.')
pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.
I tried updating pip with the command pip install -U pip setuptools
but it showed that pip is up to date.
I tried again pip install fbchat which downloaded successfully but after trying to install pandas with the same "pip install pandas" the error popped up again.**

KeyError: 'found' on Elastic2DocManager when syncing data from MongoDB

From MongoDB to Elastic Search(5.6.5), I sync the database with Mongo-Connector using Elastic2DocManager:
mongo-connector -m localhost:27017 -t localhost:9200 -d elastic2_doc_manager
After seeing some update on docs.deleted of mongodb_meta on Elastic Search:
health status index uuid pri rep docs.count docs.deleted store.size pri.store.size
yellow open mongodb_meta 3wd6OjTT6tD3f6ZGezZw 5 1 1337173 8372 192.9mb 192.9mb
mongo-connector stops working with below error:
2018-07-11 07:16:41,977 [WARNING] elasticsearch:97 - POST http://localhost:9200/_bulk [status:N/A request:10.003s]
Traceback (most recent call last):
File "c:\programdata\anaconda3\lib\site-packages\urllib3\connectionpool.py", line 387, in _make_request
six.raise_from(e, None)
File "<string>", line 2, in raise_from
File "c:\programdata\anaconda3\lib\site-packages\urllib3\connectionpool.py", line 383, in _make_request
httplib_response = conn.getresponse()
File "c:\programdata\anaconda3\lib\http\client.py", line 1331, in getresponse
response.begin()
File "c:\programdata\anaconda3\lib\http\client.py", line 297, in begin
version, status, reason = self._read_status()
File "c:\programdata\anaconda3\lib\http\client.py", line 258, in _read_status
line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
File "c:\programdata\anaconda3\lib\socket.py", line 586, in readinto
return self._sock.recv_into(b)
socket.timeout: timed out
During handling of the above exception, another exception occurred:
...
Exception in thread Thread-1:
Traceback (most recent call last):
File "c:\programdata\anaconda3\lib\threading.py", line 916, in _bootstrap_inner
self.run()
File "c:\programdata\anaconda3\lib\site-packages\mongo_connector\doc_managers\elastic2_doc_manager.py", line 150, in run
self._docman.send_buffered_operations()
File "c:\programdata\anaconda3\lib\site-packages\mongo_connector\doc_managers\elastic2_doc_manager.py", line 482, in send_buffered_operations
action_buffer = self.BulkBuffer.get_buffer()
File "c:\programdata\anaconda3\lib\site-packages\mongo_connector\doc_managers\elastic2_doc_manager.py", line 696, in get_buffer
self.update_sources()
File "c:\programdata\anaconda3\lib\site-packages\mongo_connector\util.py", line 35, in wrapped
return f(*args, **kwargs)
File "c:\programdata\anaconda3\lib\site-packages\mongo_connector\doc_managers\elastic2_doc_manager.py", line 628, in update_sources
if ES_doc['found']:
KeyError: 'found'
What is the reason for this error?
Make sure the versions are compatible.
The required python packages are installed, this is my requirements.txt look like.
astroid==1.6.5
autopep8==1.3.5
certifi==2018.8.24
elasticsearch==6.3.1
elasticsearch-dsl==6.2.1
isort==4.3.4
lazy-object-proxy==1.3.1
mccabe==0.6.1
pycodestyle==2.4.0
pylint==1.9.2
pymongo==3.7.1
rope==0.11.0
six==1.11.0
urllib3==1.23
wrapt==1.10.11

django pipeline Error: The file build/fonts/glyphicons-halflings-regular.eot' could not be found with <pipeline.storage.PipelineCachedStorage object

I am using django-pipeline, On running "sudo python manage.py collectstatic"
Getting this error:
Traceback (most recent call last):
File "manage.py", line 10, in <module> execute_from_command_line(sys.argv)
File "/Users/office/lib/python2.7/site-packages/django/core/management/__init__.py", line 338, in execute_from_command_line utility.execute()
File "/Users/office/lib/python2.7/site-packages/django/core/management/__init__.py", line 330, in execute self.fetch_command(subcommand).run_from_argv(self.argv)
File "/Users/office/lib/python2.7/site-packages/django/core/management/base.py", line 390, in run_from_argv self.execute(*args, **cmd_options)
File "/Users/office/lib/python2.7/site-packages/django/core/management/base.py", line 441, in execute output = self.handle(*args, **options)
File "/Users/office/lib/python2.7/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 168, in handle collected = self.collect()
File "/Users/office/lib/python2.7/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 120, in collect raise processed ValueError: The file 'bower_components/eonasdan-bootstrap-datetimepicker/build/fonts/glyphicons-halflings-regular.eot' could not be found with <pipeline.storage.PipelineCachedStorage object at 0x10d274e10>.
Any idea how to fix this ?
Using django-pipeline-forgiving(https://pypi.python.org/pypi/django-pipeline-forgiving) solved the issue.
pip install django-pipeline-forgiving
Set in your settings.py: STATICFILES_STORAGE = 'django_pipeline_forgiving.storages.PipelineForgivingStorage'

How to enable text search in mongo?

I tried so many things..
# in replica set configuration, specify the name of the replica set
# replSet = setname
setParameter=textSearchEnabled=true
This is the part of config file. Still after setting this the text search is not enabled.
Am using pymongo for text searching
This is my code
db.command("text", 'tracks' ,search=request.POST['content_search'], limit = 12)['results']]
My mongo version is 2.4.10. Please guide me.
This is the traceback
Traceback (most recent call last):
File "/home/nidhin/social-media-widget/env/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 114, in get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/nidhin/social-media-widget/env/local/lib/python2.7/site-packages/django/views/decorators/csrf.py", line 57, in wrapped_view
return view_func(*args, **kwargs)
File "/home/nidhin/social-media-widget/socialmedia/widget/views.py", line 84, in monitor
data = [i['obj'] for i in db.command("text", 'tracks' ,search=request.POST['content_search'], filter = test_data, limit = 12)['results']]
File "/home/nidhin/social-media-widget/env/local/lib/python2.7/site-packages/pymongo/database.py", line 435, in command
uuid_subtype, compile_re, **kwargs)[0]
File "/home/nidhin/social-media-widget/env/local/lib/python2.7/site-packages/pymongo/database.py", line 341, in _command
msg, allowable_errors)
File "/home/nidhin/social-media-widget/env/local/lib/python2.7/site-packages/pymongo/helpers.py", line 178, in _check_command_response
raise OperationFailure(msg % errmsg, code, response)
OperationFailure: command SON([('text', 'tracks'), ('filter', {'publisher_desc': u'Blogs'}), ('search', u'box'), ('limit', 12)]) failed: text search not enabled
Adding this line to config file should work:
setParameter=textSearchEnabled=true
How do you start mongdb?
Edit:
I recommend you to check that:
You have mongodb started with this config.
You could check it by calling db.runCommand("getCmdLineOpts") in MongoDb shell
via MongoDb Shell db.runCommand({getParameter:1, textSearchEnabled: 1}) returns textSearchEnabled:true