Shapefiles

This is the Forum to discuss the use of SBuilderX (version 3.10 and above). For previous versions of SBuilder please use the "SBuilder for Flight Simulator FS2004" forum.
Post Reply
iangbusa
Posts: 44
Joined: Mon Jul 07, 2014 5:10 pm

Shapefiles

Post by iangbusa » Thu Jul 10, 2014 1:04 am

Were any changes made to the way SBuilderX reads shapefiles in the latest version? I have shapefiles which 313 could read but cannot now be read for some reason...

rhumbaflappy
Posts: 420
Joined: Sat Oct 16, 2004 10:11 pm

Re: Shapefiles

Post by rhumbaflappy » Thu Jul 10, 2014 1:46 am

You might want to zip and attach a shapefile that won't work. There were changes made to the reading of the files. If a shapefile has errors, perhaps the old version will still read it, while 314 might not... just guessing.

Dick
Dick

iangbusa
Posts: 44
Joined: Mon Jul 07, 2014 5:10 pm

Re: Shapefiles

Post by iangbusa » Thu Jul 10, 2014 6:29 pm

Dick
I've attached shapefiles (OSM data from MA). Each one works in 313 but not 314.
Any idea how or why file read (format) was changed? As far as I know, shp format hasn't changed for years.
Thanks!
ian
Attachments
test shapefiles.zip
Contains two OSM test files - one line, one polygon
(176.43 KiB) Downloaded 1867 times

rhumbaflappy
Posts: 420
Joined: Sat Oct 16, 2004 10:11 pm

Re: Shapefiles

Post by rhumbaflappy » Thu Jul 10, 2014 8:58 pm

The files appear to work just fine in my build.
shapetest.png
Dick
Dick

iangbusa
Posts: 44
Joined: Mon Jul 07, 2014 5:10 pm

Re: Shapefiles

Post by iangbusa » Thu Jul 10, 2014 9:17 pm

Exactly the same files, Dick - now what have I done wrong?!!! :lol: :roll:
Attachments
Capture.JPG

iangbusa
Posts: 44
Joined: Mon Jul 07, 2014 5:10 pm

Re: Shapefiles

Post by iangbusa » Mon Jul 14, 2014 11:03 pm

Does anyone have any thoughts on this other than "it works for me"? I see that but it doesn't work for me. Is it possible that it's something to do with permissions related to whatever dll or application component is used to read shapefiles? Is it something to do with me placing the 64-bit application in the Program Files folder (for 64-bit programs) and from there it's not allowed to access 32-bit dll's? I couldn't get the new 64-bit version to work in Program Files (x86). Is it even possibly a Windows 8.1 problem? :?:

The shapefile example I attached is from OSM. I'm also working with professionally produced (commercial sourced) shapefiles that can no longer be read. There is no doubt that the files themselves follow every standard related to the shp format - so where have I gone wrong that now prevents them from being read? :shock:

Any suggestions welcome! :lol:

iangbusa
Posts: 44
Joined: Mon Jul 07, 2014 5:10 pm

Re: Shapefiles

Post by iangbusa » Tue Jul 15, 2014 2:33 am

Could the problem in this post be connected to my shapefile problem?

http://www.ptsim.com/forum/viewtopic.php?f=22&t=2289

Also, I noticed a post mentioning the two versions possibly becoming "confused" by "shared" (my words) Registry entries. Another possible source of 64- or 32-bit mismatch?

Meanwhile I'm going to uninstall every copy I can find on my machine (should only be one), check the Registry, and install from the zip Dick has posted. I'll let you know if this works.

User avatar
Luis Sa
Posts: 1736
Joined: Sun May 18, 2003 11:17 am
Location: Portugal
Contact:

Re: Shapefiles

Post by Luis Sa » Tue Jul 15, 2014 8:16 am

Hello,

In fact I had to change the code to read Shape files in the 314 version. All shape file input and output used the shapelib.dll standard library. This free library is used in almost all programs that interact with shape files. However the shapelib.dll is for 32-bit Windows systems and was never (officially) updated for 64-bit systems. We discovered, in the web, a shapelib.dll file produced by others that, supposedly, is compatible with 64-bit systems. This file is the one that we distribute in the 314 update.

However, we find a problem with this new dll. It could not read the database files that belong to the shape file set. The only way to read the database files (and then the whole shape set) was to read them directly by SBuilderX without recurring to shapelib.dll.

I tested this reading code with many database files and it worked OK. May be we should test a bit more. If your problem persists I can look at it when I return home. However I am almost sure that the problem is on the database file. You can edit these files easily (Excel I suppose) and, may be, there is something in your files that confuses my code.

I hope you can solve your problem,

Regards, Luis (in Marina Salinas, Torrevieja, Spain)

iangbusa
Posts: 44
Joined: Mon Jul 07, 2014 5:10 pm

Re: Shapefiles

Post by iangbusa » Tue Jul 15, 2014 2:34 pm

Hi Luis

Thanks for your post. I hadn't intended to disturb your "navigation". I hope the sailing's going well. Looks like you've moved on from the islands and the weather's improved from when we last corresponded.

I'll keep trying the files by seeing if any data changes make a difference.

One other thing to consider when you get back, possibly, is looking for a different dll. I use QGIS which is an open source GIS program reading many file formats, including shapefiles, in 32- or 64-bit. Programs like this must use freely available routines to read the files (GDAL/OGR?). Certainly it reads the files I have as a 64-bit program with no difficulty, as does SBX 313 in 32-bit. I'll check and ask around. Would you mind if, for example, we ask Arno, what he uses in one of his programs like scenProc for 64-bit? It reads shp, including mine...

Meanwhile, where are you headed next, skipper? I hope you get fair winds and moderate seas! 8)

iangbusa
Posts: 44
Joined: Mon Jul 07, 2014 5:10 pm

Re: Shapefiles

Post by iangbusa » Tue Jul 15, 2014 3:41 pm

iangbusa wrote:...Would you mind if, for example, we ask Arno, what he uses in one of his programs like scenProc for 64-bit?...
I asked him (discreetly - not mentioning SBX) what he uses. He got his dll's for 32- and 64-bit from

http://shapelib.maptools.org/

He has to have two completely separate installs for his application to work in their respective environments.

Hope this can help.

User avatar
Luis Sa
Posts: 1736
Joined: Sun May 18, 2003 11:17 am
Location: Portugal
Contact:

Re: Shapefiles

Post by Luis Sa » Tue Jul 15, 2014 11:52 pm

Hello,

We are at Costa Blanca in Marina Salinas, Torrevieja, until July 18. Then we carry on, on our way to Oporto!

I just opened your 2 shape files without error! Since Dick also got them right, you should double check your update installation.

I think I am using the same shapelib.dll file as Arno. However, I can assure you that I could not read the database part of an ESRI file.

Best Regards, Luis

iangbusa
Posts: 44
Joined: Mon Jul 07, 2014 5:10 pm

Re: Shapefiles

Post by iangbusa » Wed Jul 16, 2014 12:15 am

Hi Luis!

That's quite a leg you have planned there or are you stopping in for overnights at various places?

Anyway - yes, it really does seem as though there's something strange about my update installation. The only thing I thought was that Arno mentioned both 32-bit and 64-bit dll files and I wasn't sure if you had changed that in the 64-bit update patch.

Something is "confusing" my set up when it goes to look for dll files possibly. I do not believe it can be in the data because you and Dick can read the files (in 314) and I can read them in 313.

Something to think about during the long night watches as you stare out and navigate by the stars!

Thanks!
ian

iangbusa
Posts: 44
Joined: Mon Jul 07, 2014 5:10 pm

Re: Shapefiles

Post by iangbusa » Thu Jul 24, 2014 9:24 pm

(Also posted on FSDeveloper)

From what I can see, because I've run under Windows 7.1 successfully and [not] under 8.1, the problem appears to be in Windows 8.1 with the shapelib.dll and the way it's used by SBX 314. The same dll functions without a problem with other applications like scenProc under Windows 8.1. Hopefully this will provide a clue regarding what to look for or, at least, a workaround that it runs fine under 7.1.

Please let me know, when the time is right etc, if I can be of any help at all in trying to see what's going on...

ian

User avatar
Luis Sa
Posts: 1736
Joined: Sun May 18, 2003 11:17 am
Location: Portugal
Contact:

Re: Shapefiles

Post by Luis Sa » Thu Jul 24, 2014 10:35 pm

Thanks Ian,

My first problem :oops: is that I have not Windows 8.1 (unless I borrow my wife 's computer). May be I need to test shapelib on a Windows 8 (in Windows 7 I was getting a error with shapelib and I had to write some bypass code).

My second problem 8) is that I am 40 miles from Gibraltar, still a long way to Porto!

Regards, Luis

iangbusa
Posts: 44
Joined: Mon Jul 07, 2014 5:10 pm

Re: Shapefiles

Post by iangbusa » Thu Jul 24, 2014 11:10 pm

Luis Sa wrote:My second problem 8) is that I am 40 miles from Gibraltar, still a long way to Porto!
Obrigado - we can perhaps worry about all this at the right time and when there is time! Now focus on the tricky currents in the Straits of Gibraltar, Luis! Make sure you don't hit Gibraltar or Ceuta... Hopefully you're nav gear doesn't run on Windows! :lol:

Bon voyage, sir!

Post Reply