#4331 closed enhancement (fixed)
Adding SXF file format driver
Reported by: | bidandou | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | OGR_SF | Version: | unspecified |
Severity: | normal | Keywords: | SXF |
Cc: | warmerdam, dron, rutsky |
Description (last modified by )
the goal of the work is to add a GDAL driver supporting the SXF (Storage and eXchange Format).
This file format is largely used in the eastern europe, and is primarly produced by a GIS software Called Panorama GIS MAP developped by the Russian KB Panorama Entreprise
informationons on :
http://www.gisinfo.net/
Specification on (in Russian Language) :
http://gistoolkit.ru/download/doc/sxf4bin.pdf
Attachments (13)
Change History (48)
by , 12 years ago
Attachment: | drv_sxf.html added |
---|
by , 12 years ago
Attachment: | makefile.vc added |
---|
by , 12 years ago
Attachment: | GNUmakefile added |
---|
comment:1 by , 12 years ago
Cc: | added |
---|
comment:2 by , 12 years ago
Description: | modified (diff) |
---|
comment:3 by , 12 years ago
Description: | modified (diff) |
---|
comment:4 by , 12 years ago
Description: | modified (diff) |
---|
comment:5 by , 12 years ago
Description: | modified (diff) |
---|
comment:6 by , 12 years ago
SXF datasets that could be used to test the contribution :
some SXF files exist on thos URL :
http://gistoolkit.ru/download/
the most interesting thing is the availability of a free downladable softwares in the above site alowing the cration and the export of SXF files in different configurations to do tests.
see: http://www.gisinfo.net/download/download.htm
for the OS I used to test my driver : Windows XP SP3 and Windows 7?
I'm Using Visual Studio 2008 Expess Edition for the developpement. dont try to compile with gcc.
I submit the files above just to know how does mechanism of contriburions work. My work is not finished.
Thank you for your interest, soon I'll correct my work and I'll submit more comprehensible code.
by , 12 years ago
by , 12 years ago
Attachment: | ogrsxfdatasource.cpp added |
---|
by , 12 years ago
Attachment: | ogrsxfdriver.cpp added |
---|
by , 12 years ago
Attachment: | org_sxf_defs.h added |
---|
by , 12 years ago
by , 12 years ago
by , 12 years ago
Attachment: | systypes.h added |
---|
by , 12 years ago
Attachment: | ogrsxflayer.cpp added |
---|
comment:7 by , 12 years ago
Ali, (sorry if I misidentified your first name ?)
Thanks for the updates.
- I'd note that there are still identations problems in ogrsxflayer.cpp.
- I suppose that the ogr_sxf_defs.h comes from the spec of http://gistoolkit.ru/download/doc/sxf4bin.pdf. Am I right ? Translated into English : http://translate.google.fr/translate?sl=ru&tl=en&u=http%3A%2F%2Fgistoolkit.ru%2Fdownload%2Fdoc%2Fsxf4bin.pdf
- I looked at the links you provided but couldn't find a SXF file sample in them. There are just too many files to open them one by one. Could you point me at the precise URL for a sample file ? Thanks
- Do you consider your work ready enough, or are there still some changes you intend to do before I start integrating ? You can always submit additional patches later.
comment:8 by , 12 years ago
Yes you are right, the ogr_sxf_defs.h comes from the spec of the SXF file format transtated to english.
you can find an SXF file in :
For now I consider that my work is not ready enough, there still some importants thinks to do, so I'd like to have time to do that.
Thank you for you assistance
comment:9 by , 12 years ago
Description: | modified (diff) |
---|
comment:10 by , 12 years ago
Description: | modified (diff) |
---|
follow-up: 12 comment:11 by , 12 years ago
Hi,
Just found a time to look into this issue.
I should say that I have a code for SXF format developed by me several years ago, but it is still out of OGR tree because there were no pressing need for that driver (and the OGC SF model is not sufficient for SXF, so I developed a separate library for SXF reading and writing to be able to explore all the features of the format). Moreover, I actually have two drivers: the one based on SDK from KB Panorama, and another one with my own code only. I should note that official format spec is bad and vague and a bit of experimentation and reverse engineering is needed to properly read SXF files.
There is a separate contribution now, so I am bit late with my own stuff, but it is certainly a time to introduce this new driver. So we need to come to some solution how we will proceed. I can invest some time for this development and push my code too. Though I don't want to put down a new contributor I should note that my code supports more SXF variations and goes further. Also it is architecture and compiler independent.
Best regards, Andrey
comment:12 by , 12 years ago
Hi,
I'm happy to see that idea of the introduction of the new SXF driver is well accepted by you. If you got code that can drive the development of the driver forward you're invited to contribute with me if you want, even if you want to take the lead of the development process, I have no objection.
The most important to me is the introduction of this new driver in GDAL, and making it accessible to all the people that want it.
Elsewhere, if you haven't enough time, you can send me the code you developed and I will introduce it my own work (with your copyright of course).
Best regards, Ali
comment:13 by , 12 years ago
I am working on integration of my code in GDAL now, I hope it will be ready at the end ow the week. I will put the code here for review after that.
Best regards, Andrey
follow-up: 15 comment:14 by , 12 years ago
Andrey, will this be in for Beta2 in the next few days? Or should we defer this to post 1.9?
comment:15 by , 12 years ago
Replying to warmerdam:
Andrey, will this be in for Beta2 in the next few days? Or should we defer this to post 1.9?
Definitely it should go in the next release. It will need testing and maybe some improvements.
comment:16 by , 12 years ago
Milestone: | 1.9.0 → 2.0.0 |
---|
comment:17 by , 11 years ago
Hi Andrey,
I see that nothing is changing about SXF driver and no new code is posted to the gdal tree.
If you are not interested on working on that driver, please tell me so I continue my work.
Best regards, Ali.
comment:18 by , 11 years ago
Hi warmerdam,
I see that nothing is changing about SXF driver and no new code is posted to the gdal tree from more than 10 months.
I want to know if I can work again on that driver, please tell me if I can continue my work.
Best regards, Ali.
comment:19 by , 10 years ago
This is the major rewrite of the sxf driver, tested with various SXF samples. This work was done by us at NextGIS for Vega corp. I think the driver is ready to be included in the next release. We are offering to maintain it in the future. Let me know what next steps should be.
comment:20 by , 10 years ago
Dmitry, you're a GDAL committer, so you can just push the code.
Just skimming quickly through the code, I see that you will need to add the registration of the driver in OGRAllRegister() and add the driver in the Unix/Windows makefiles. See r26470 (for example) for the list of files that need to be modified.
If you have data that is small enough to be put in SVN (ideally < 100K) and with an appropriate license, it would be good to add a few tests in autotest/ogr.
I don't know if you've already used it, but you can also use the "test_ogrsf" utility to test the driver behaviour w.r.t. OGR API expectations. You must build it explicity with "make test_ogrsf" in the app directory.
I see a few occurences of CPLError( CE_Fatal . This will abort the process (which can be annoying in a desktop application). It is generally better to issue a CE_Failure and error out more cleanly.
I also see use of dereferencing of items in buffer with patterns like "*dfX = *(double *)(psBuff + 8)". This would cause portability issue on non-Intel platforms that are big-endian and/or have strict pointer alignment requirements. memcpy() + CPL_LSBxxxx macros in cpl_port.h can be used for that purpose.
comment:22 by , 10 years ago
Cc: | added |
---|
comment:24 by , 10 years ago
comment:25 by , 10 years ago
comment:26 by , 10 years ago
r26768 "SXF: fix so that GetNextFeature() works directly (fix ogrinfo -q) (#4331)"
comment:27 by , 10 years ago
comment:29 by , 10 years ago
comment:30 by , 10 years ago
comment:31 by , 10 years ago
Dmitry, I'm attaching a patch (sxf_hardening.patch) that fixes robustness issues against invalid data that have cause crashes while running the test data file in a fuzzing tool that generates random variations of the initial file. I've verified that the patch doesn't change the output of ogrinfo -al on the test data file, but you might want to check that the added checks don't cause functional regressions on other files.
by , 10 years ago
Attachment: | sxf_hardening.patch added |
---|
follow-up: 35 comment:34 by , 10 years ago
About r26786 there's a leak of pszRecoded around line 1202
The naming for szFontEnc is a bit inconsistant with the usual Hungarian conventions. Should rather be a nFontEnc I believe.
I have several high level remarks and questions :
Note : to avoid the proliferation of files when you update new revisions of your work, you can overwrite existing files attached to the ticket by checking the "Replace existing attachment of the same name" box.
CC'ing Andrey Kiselev who has contributed stuff in GDAL for Panorama SRS
Merci de votre contribution !