Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for large DBF/SHP files #3514

Closed
mapserver-bot opened this issue Apr 3, 2012 · 7 comments
Closed

Support for large DBF/SHP files #3514

mapserver-bot opened this issue Apr 3, 2012 · 7 comments
Assignees
Milestone

Comments

@mapserver-bot
Copy link

Reporter: jmckenna
Date: 2010/08/13 - 17:12
Trac URL: http://trac.osgeo.org/mapserver/ticket/3514
One of the requirement's of this year's benchmarking exercise is to display a large shapefile (DBF is 2.9GB, SHP is 1.3 GB). The file's name is 'buildings.shp'. The problem is that with native MapServer the file is not displaying. If I change to an OGR connection the file does display. Other server teams can display this same shapefile (in fact 2 days ago GeoServer had to be modified to display this same large shapefile...'use longs instead of ints for dbase offsets'). MapServer must also be hitting some kind of limit with this file.

I have created a small mapfile on the Linux and Windows benchmark machines (/benchmarking/mapserver/buildings-test.map). We can provide full access to these machines if you wish.

Also here are working getmap requests showing our problem:

@mapserver-bot
Copy link
Author

Author: warmerdam
Date: 2010/08/13 - 17:31
The same issue was encountered in shapelib, and the solution was too use a "large file API" for access to the DBF file instead of the traditional '32bit signed' stdio. There may also need to be some care with use of unsigned longs instead of signed longs for offset calculations.

I could take on this ticket if Daniel wants it addressed as part of our maintenance arrangement.

@mapserver-bot
Copy link
Author

Author: pramsey
Date: 2010/08/13 - 17:41
The "hack fix" approach is available here, if you are in a hurry and not committing back.

http://trac.osgeo.org/postgis/changeset/5787

@mapserver-bot
Copy link
Author

Author: warmerdam
Date: 2010/08/13 - 17:51
I would note this (Paul's referenced patch) is only likely to help on 64bit systems with long and int are not the same.

@mapserver-bot
Copy link
Author

Author: dmorissette
Date: 2010/08/16 - 17:12
Frank, yes please go ahead. Note however that since this is more than just a trivial fix it should happen only in 6.0 and cannot be backported to 5.6 unless the PSC decides to make an exception.

@mapserver-bot
Copy link
Author

Author: warmerdam
Date: 2010/08/19 - 06:01
My usual approach to large file support is to "hook" the IO api. On unix there are a few options as seen in gdal/port/cpl_vsil_unix_stdio_64.cpp while on windows I use the native win32 file io api (CreateFile(), etc). However, this is a fairly heavy weight approach. Digging a bit deeper, for instance in http://www.suse.de/~aj/linux_lfs.html it seems there are easier alternatives.

I have confirmed that on 32bit linux defining _FILE_OFFSET_BITS=64 allows writing large files. But it does not alter the "long" argument to fseek(). I will continue to dig...

@mapserver-bot
Copy link
Author

Author: warmerdam
Date: 2010/08/19 - 07:08
Preliminary incompletely tested fix in trunk (63101db (r10462), 1bddcb4 (r10463)). I have not confirmed mapserver itself working with a >2GB file. The fix should work on VStudio 2005 or later, newish 32bit unix/linux and 64bit unix/linux.

It would be fairly involved to test so I'm going to "assume" it works for now.

@mapserver-bot
Copy link
Author

Author: jmckenna
Date: 2010/08/19 - 13:05
I have confirmed this fix with the problem 2.9GB DBF file, on Windows x64. Great work Frank!!!! Thank you so much. I'll ask Mike to rebuild MapServer on Linux to test and I will report back.

@ghost ghost assigned warmerdam Apr 5, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants