Page 1 of 1

Shapefiles

Posted: Thu Jul 10, 2014 1:04 am
by iangbusa
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...

Re: Shapefiles

Posted: Thu Jul 10, 2014 1:46 am
by rhumbaflappy
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

Re: Shapefiles

Posted: Thu Jul 10, 2014 6:29 pm
by iangbusa
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

Re: Shapefiles

Posted: Thu Jul 10, 2014 8:58 pm
by rhumbaflappy
The files appear to work just fine in my build.
shapetest.png
Dick

Re: Shapefiles

Posted: Thu Jul 10, 2014 9:17 pm
by iangbusa
Exactly the same files, Dick - now what have I done wrong?!!! :lol: :roll:

Re: Shapefiles

Posted: Mon Jul 14, 2014 11:03 pm
by iangbusa
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:

Re: Shapefiles

Posted: Tue Jul 15, 2014 2:33 am
by iangbusa
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.

Re: Shapefiles

Posted: Tue Jul 15, 2014 8:16 am
by Luis Sa
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)

Re: Shapefiles

Posted: Tue Jul 15, 2014 2:34 pm
by iangbusa
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)

Re: Shapefiles

Posted: Tue Jul 15, 2014 3:41 pm
by iangbusa
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.

Re: Shapefiles

Posted: Tue Jul 15, 2014 11:52 pm
by Luis Sa
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

Re: Shapefiles

Posted: Wed Jul 16, 2014 12:15 am
by iangbusa
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

Re: Shapefiles

Posted: Thu Jul 24, 2014 9:24 pm
by iangbusa
(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

Re: Shapefiles

Posted: Thu Jul 24, 2014 10:35 pm
by Luis Sa
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

Re: Shapefiles

Posted: Thu Jul 24, 2014 11:10 pm
by iangbusa
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!