tudelft3d / matahn

Download tool for AHN2 that delivers a LAZ file with the points inside a bounding box drawn by the user.
http://3dsm.bk.tudelft.nl/matahn
GNU General Public License v3.0
2 stars 2 forks source link

problem reading non-AHN2 tiles #2

Open squeakus opened 9 years ago

squeakus commented 9 years ago

Firstly, may I thank you for making this amazing piece of software. We have a scan of the Dublin city centre and want to make it easily accessible to the public, your software looks like it will make this possible.

I have managed to install all the dependencies, set up everything, initialise the database and generate the metadata files for the laz files. I hit a problem when I try to import the tiles. I call the load_tiles_into_db() function but I get the following error message:

File "matahn/tile_io.py", line 75, in get_tile_from_file ewkt = get_ewkt_from_pointlist( BLADINDEX[ahn2_bladnr] ) KeyError: 't0003'

I looked at the code and it seems to be parsing the filename to create a key, my filenames are of the format pt000312.laz pt000313.laz pt000315.laz

I changed it to parse out the number part of the string but got a similar error. what formatting should I use for mylas filenames?

Ylannl commented 9 years ago

Some parts of the code are 'hardcoded' for AHN2, the dutch national lidar dataset. For instance when a tile is imported it is assumed the filename corresponds to a tile-index specific to AHN2. This is probably the cause of your problem.

I'll have a look at it next week. It should be a trivial fix. Great to hear that you are considering to use our software!

squeakus commented 9 years ago

Okay, here is the tile format for our dataset: https://www.google.com/maps/d/viewer?mid=z7N-R3Q_rBzg.k6PjR7BhHAeg Just let me know the changes I have to make. Thanks again for your help!

On 3 October 2015 at 19:58, Ravi Peters notifications@github.com wrote:

Some parts of the code are 'hardcoded' for AHN2, the dutch national lidar dataset. For instance when a tile is imported it is assumed the filename corresponds to a tile-index specific to AHN2. This is probably the cause of your problem.

I'll have a look at it next week. It should be a trivial fix. Great to hear that you are considering to use our software!

— Reply to this email directly or view it on GitHub https://github.com/tudelft3d/matahn/issues/2#issuecomment-145278705.

Ylannl commented 9 years ago

try the noahn2 branch. Just some quick and untested hacks.

squeakus commented 9 years ago

Hi Ravi, Edging ever closer!! I used the noahn2 branch and it got rid of the index error. I then hit the following error:

(psycopg2.DataError) value too long for type character varying(5) [SQL: 'INSERT INTO tiles (path, ahn2_bladnr, ahn2_class, active, pointcount, geom) VALUES (%(path)s, %(ahn2_bladnr)s, %(ahn2_class)s, %(active)s, %(pointcount)s, ST_GeomFromEWKT(%(geom)s)) RETURNING tiles.id'] [parameters: {'ahn2_bladnr': 'pt000363', 'pointcount': 3425698, 'ahn2_class': 'g', 'geom': 'SRID=28992;POLYGON((315899.0 234399.0, 316000.0 234399.0, 316000.0 234500.0, 315899.0 234500.0, 315899.0 234399.0))', 'active': True, 'path': '/scans/oconnell/pt000363.laz'}]

I assumed that this had to do with the filename so I changed pt000363.laz to p363.laz and moved the ground files to a different folder and it successfully created the tiles table in the database. Should it be limiting the filename to 5 characters?

I am now hitting an error when running "celery -A matahn.celery_app worker". ImportError: No module named db+SQLALCHEMY_DATABASE_URI

I had assumed this string was populating itself by being evaluated and combining the db variable with the sqlalchemy_database_uri variable I defined in the config file: SQLALCHEMY_DATABASE_URI = 'postgresql://myuser:mypassword@localhost /mydbname'

I tried setting this manually but I got a similar error: CELERY_RESULT_BACKEND = 'postgresql://myuser:mypassword@localhost/mydbname'

How should I be setting this variable?

On 5 October 2015 at 09:19, Ravi Peters notifications@github.com wrote:

try the noahn2 branch. Just some quick and untested hacks.

— Reply to this email directly or view it on GitHub https://github.com/tudelft3d/matahn/issues/2#issuecomment-145460904.

Ylannl commented 9 years ago

see this. As you noted, there was a small error in the example config file, be sure to put the brackets and the +'s properly.

The 5 character limit, is related to the current database schema which is again based on AHN2 conventions. Your workaround seems OK to me until I find the time to properly fix it.

squeakus commented 9 years ago

That was it, I put in the + and celery started working. I am still having problems running the server but I think that is because of my flask setup. Thanks for getting me through the setup and for making this great piece of software publicly available!

On 5 October 2015 at 15:11, Ravi Peters notifications@github.com wrote:

see this https://github.com/tudelft3d/matahn/commit/8ae7d07c152bb73775888e2d0b3acce2deb5b796. As you noted, there was a small error in the example config file, be sure to put the brackets and the +'s properly.

The 5 character limit, is related to the current database schema which is again based on AHN2 conventions. Your workaround seems OK to me until I find the time to properly fix it.

— Reply to this email directly or view it on GitHub https://github.com/tudelft3d/matahn/issues/2#issuecomment-145541080.