• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

Format of width data in shape file to import to SBuilderX?

Messages
15
Country
russia
Hi All,
I am trying to import shp file with additional width data for lines. But if I set "Get width from field WIDTH" I get message "Field "WIDTH" is not a double precision number and will be ignored".
In my shape file editor I have next values for its type:
- short integer
- long integer
- float with additional precision and scale fields (whole and fractional part as I understood)
- double with the same fields as above.
First two types give the message as described above.
If I set double or float and set some values for precision and scale when I try to import shp I get error:

Error Report created by SBuilderX on 30.11.2009 2:32:27

Attempted to read or write protected memory. This often indicates that other memory is corrupt.

System.AccessViolationException: Attempted to read or write protected memory. This often indicates that other memory is corrupt.
in SBuilderX.moduleSHAPE.DBFIsAttributeNULL(Int32 hdbf, Int32 iShape, Int32 iField)
in SBuilderX.moduleSHAPE.AppendSHPLines(String filename, Int32 NoOfItems, Boolean IsZ)
in SBuilderX.moduleSHAPE.AppendSHPFile(String filename)
in SBuilderX.frmStart.AppendSHPMenuItem_Click(Object sender, EventArgs e)
in System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
in System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
in System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
in System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
in System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
in System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
in System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
in System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
in System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
in System.Windows.Forms.Control.WndProc(Message& m)
in System.Windows.Forms.ScrollableControl.WndProc(Message& m)
in System.Windows.Forms.ToolStrip.WndProc(Message& m)
in System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
in System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
in System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
in System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

So does anyone know what type of that damn width should I use to import all my data to SBuilderX?
 
I think SBX uses shapelib to process shape files, and from what I can see shapelib reads fields in the dbf file as String, Integer, Double, and Logical. I looks like it doesn't matter how the field format it set in the dbf file, i.e., C,D,F,N,L,M. If the field has no decimal places defined it gets read as integer, if it does it will be read as double. So it appears (and a quick test seems to prove) that if you create a width attribute of type N (number) with zero decimal places (I used 5) then shapelib will read it as integer and SBX won't accept it. If instead you create the same width attribute of type N with 1 or more decimal places (I used 5.0) then shapelib will read it as double and SBX will accept it.

I don't know what you are using to create your shape file dbf, but see if you can get it to take a decimal value (or force 1 or more decimal places) and then try to append it into SBX.

scott s.
.
 
Back
Top