Git Product home page Git Product logo

Comments (4)

autra avatar autra commented on September 21, 2024

Looks like you're trying to load some js / assets from a different origin than your webserver. Are you using the file:/// protocol ? If yes, you shouldn't (generally speaking, it's always a bit difficult to work with this protocol : a lot of differences between browsers, some security policy that will make your website crash etc...)

from lopocs.

pizzuga avatar pizzuga commented on September 21, 2024

Hello,
I cannot display correctly "lyon" example data with lopocs due to this error:

psycopg2.pool.PoolError: connection pool exhausted

As i'm not a programmer and I had to do some changes to make lopocs works on Debian (see at the bottom), I wonder if it can be due to my modifications or if there are some settings to change in the pool side

Following, part of the log:

[2020-03-11 20:03:48,493] ERROR in app: Exception on /3dtiles/public.lyon.points/read.pnts [GET]
Traceback (most recent call last):
  File "/opt/lopocs/venv/lib/python3.7/site-packages/flask/app.py", line 1949, in full_dispatch_request
    rv = self.dispatch_request()
  File "/opt/lopocs/venv/lib/python3.7/site-packages/flask/app.py", line 1935, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/opt/lopocs/venv/lib/python3.7/site-packages/flask_restplus/api.py", line 313, in wrapper
    resp = resource(*args, **kwargs)
  File "/opt/lopocs/venv/lib/python3.7/site-packages/flask/views.py", line 89, in view
    return self.dispatch_request(*args, **kwargs)
  File "/opt/lopocs/venv/lib/python3.7/site-packages/flask_restplus/resource.py", line 44, in dispatch_request
    resp = meth(*args, **kwargs)
  File "/opt/lopocs/lopocs/app.py", line 159, in get
    args.get('lod')
  File "/opt/lopocs/lopocs/threedtiles.py", line 58, in ThreeDTilesRead
    [tile, npoints] = get_points(session, box, lod, offsets, pcid, scales, schema)
  File "/opt/lopocs/lopocs/threedtiles.py", line 125, in get_points
    sql = sql_query(session, box, pcid, lod)
  File "/opt/lopocs/lopocs/threedtiles.py", line 186, in sql_query
    patch_size = session.patch_size
  File "/opt/lopocs/lopocs/database.py", line 234, in patch_size
    return self.query(sql)[0][0]
  File "/opt/lopocs/lopocs/database.py", line 466, in query
    with cls._execute(query, parameters) as cursor:
  File "/usr/lib/python3.7/contextlib.py", line 112, in __enter__
    return next(self.gen)
  File "/opt/lopocs/lopocs/database.py", line 450, in _execute
    with cls._conn() as conn:
  File "/usr/lib/python3.7/contextlib.py", line 112, in __enter__
    return next(self.gen)
  File "/opt/lopocs/lopocs/database.py", line 442, in _conn
    conn = cls.pool.getconn()
  File "/opt/lopocs/venv/lib/python3.7/site-packages/psycopg2/pool.py", line 168, in getconn
    return self._getconn(key)
  File "/opt/lopocs/venv/lib/python3.7/site-packages/psycopg2/pool.py", line 91, in _getconn
    raise PoolError("connection pool exhausted")
psycopg2.pool.PoolError: connection pool exhausted
192.168.0.102 - - [11/Mar/2020 20:03:48] "GET /3dtiles/public.lyon.points/read.pnts?v=0.0&lod=2&bounds=[4440967.31950011,375461.372910486,4547185.11007563,4441167.6970001105,375719.772910486,4547372.6850756295] HTTP/1.1" 500 -
192.168.0.102 - - [11/Mar/2020 20:03:48] "GET /3dtiles/public.lyon.points/read.pnts?v=0.0&lod=2&bounds=[4440967.31950011,375719.772910486,4547185.11007563,4441167.6970001105,375978.172910486,4547372.6850756295] HTTP/1.1" 200 -
192.168.0.102 - - [11/Mar/2020 20:03:49] "GET /3dtiles/public.lyon.points/read.pnts?v=0.0&lod=2&bounds=[4440967.31950011,375202.97291048605,4547185.11007563,4441167.6970001105,375461.372910486,4547372.6850756295] HTTP/1.1" 200 -
192.168.0.102 - - [11/Mar/2020 20:03:49] "GET /3dtiles/public.lyon.points/read.pnts?v=0.0&lod=2&bounds=[4441368.07450011,374944.572910486,4546809.96007563,4441568.4520001095,375202.97291048605,4546997.53507563] HTTP/1.1" 200 -
192.168.0.102 - - [11/Mar/2020 20:03:49] "GET /3dtiles/public.lyon.points/read.pnts?v=0.0&lod=2&bounds=[4440967.31950011,374944.572910486,4547185.11007563,4441167.6970001105,375202.97291048605,4547372.6850756295] HTTP/1.1" 200 -


and in the attached image what I see

Schermata del 2020-03-11 19-54-49


My configuration:

VMWare Player Virtal machine, 40 giga hd, 4096MB of memory for the VM (32 Giga for the host)
Debian 10 stable
PostgreSQL 11 (repository)
PDAL (from GIT to have lazperf and laszip)

I did some changes in the following files:


setup.py

--  'pyproj==1.9.5.1',
    'pyproj==1.9.6',
-- downgrade
    'werkzeug==0.16.1'


lopocs/cli.py

--    offset_x = summary['bounds']['X']['min'] + (summary['bounds']['X']['max'] - summary['bounds']['X']['min']) / 2
--    offset_y = summary['bounds']['Y']['min'] + (summary['bounds']['Y']['max'] - summary['bounds']['Y']['min']) / 2
--    offset_z = summary['bounds']['Z']['min'] + (summary['bounds']['Z']['max'] - summary['bounds']['Z']['min']) / 2

    offset_x = summary['bounds']['minx'] + (summary['bounds']['maxx'] - summary['bounds']['minx']) / 2
    offset_y = summary['bounds']['miny'] + (summary['bounds']['maxy'] - summary['bounds']['miny']) / 2
    offset_z = summary['bounds']['minz'] + (summary['bounds']['maxz'] - summary['bounds']['minz']) / 2


--        xmin, ymin, zmin = transform(pini, pout, summary['bounds']['X']['min'], summary['bounds']['Y']['min'], summary['bounds']['Z']['min'])
--        xmax, ymax, zmax = transform(pini, pout, summary['bounds']['X']['max'], summary['bounds']['Y']['max'], summary['bounds']['Z']['max'])

        xmin, ymin, zmin = transform(pini, pout, summary['bounds']['minx'], summary['bounds']['miny'], summary['bounds']['minz'])
        xmax, ymax, zmax = transform(pini, pout, summary['bounds']['maxx'], summary['bounds']['maxy'], summary['bounds']['maxz'])


lopocs/database.py

        server_version = full_server_version.split()[0]  # Keep only "X.X.X"
--        server_version = server_version_full.split()[0]  # Keep only "X.X.X"


(venv) root@sdi:/opt/lopocs# lopocs demo --sample lyon --work-dir demos --server-url http://192.168.0.120:5000 --cesium

ln -s /opt/lopocs/demos/ /var/www/html/lopocs

(venv) root@sdi:/opt/lopocs# lopocs serve --host 192.168.0.120

from lopocs.

pizzuga avatar pizzuga commented on September 21, 2024

Partially solved modifying row 193 in lopocs/database.py, and putting a different maxconn number in ThreadedConnectionPool

#        cls.pool = ThreadedConnectionPool(1, cpu_count(), query_con)
        cls.pool = ThreadedConnectionPool(1, 50, query_con)

But I really don't know what kind of consequences it could arise

from lopocs.

delhomer avatar delhomer commented on September 21, 2024

Moved to https://gitlab.com/Oslandia/lopocs/-/issues/33

from lopocs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.