Jump to content
Sign in to follow this  
Guest luissa

ESRI Shape Files?

Recommended Posts

I cannot seem to get specific road types to appear from ESRI shapefiles. I am using MapEdit to view the files. I tell ESRI to download the roads info which it does. Then, in MapEdit, I am asked for the type of item. I have tried FROM FIELD and FROM LIST to no avail. All of the roads show up as one visual type and when examining the properties of a road it is always "unknown".This is probably procedural errors on my part but there are no help files for MapEdit so it is down to just trying combinations, which to daate have been fruitless..???Dick Boley @KLBE


regards,

Dick near Pittsburgh, USA

Share this post


Link to post
Share on other sites

Hi Dick.I'm not that familiar with GPSMapEdit, but FGIS from the University of Wisconsin, and GlobalMapper ( a commercial program ) both need you to edit the data table to isolate the types of roads you wish to display, and perhaps save a new file of just that data type as a new shapefile.Otherwise, both programs display all the roads.FGIS can allow the assignation of different colors to different line types, so a map can be saved of that view. Information on different attributes of the lines or polys is in the data table... sometimes called the shapetable. It's the DBF file that accompanies the SHP file.Dick

Share this post


Link to post
Share on other sites

I was able to open the DBF file in Excel. I can change the type for roads very easily. Errors are obvious if you know the correct type from local experience. Problem is saving the file back to a format acceptable by MapEdit, the program I use(free). The extension is dbf but the DBase (dbf usually relats to DBase) dbf extensions available in Excel Save As are not accepted by MapEdit. Knew it was too easy!Dick Boley @KLBE


regards,

Dick near Pittsburgh, USA

Share this post


Link to post
Share on other sites
Guest Horst

Hello,@nudataYou are right, this must be a very interested import.Currently it is not possible. And I do not know, if it can be done.You can select only a column in

Share this post


Link to post
Share on other sites
Guest luissa

Hi Dick (nudata)I read your post here and in the PTSim forum. I am not familar with the dBase format and I run precisely into your difficulty :-hmmm . I can open the file in Excel but some of my editing is lost when I save it back in DBF format (you must force Excel to save in DBF). Here is a tip that you can use to import all types of roads from a Shape file into SBuilder (through MapEdit) in a single step (alternatively you can use the tip suggested by Dick, that is, create one SHP file for each type of road, or by Horst, that is edit the type graphically in MapEdit):1) Open the DBF file in Excel and see if you can allow the "destruction" of one column (field) by using it to specify the type of the roads.2) For the purpose of getting the data into SBuilder you only need the field referred to in 1). But, if you find a column with the label (names) of the roads, keep that one and use another one for the type. The reason is that, later, in SBuilder, you can, for example, find a VTP line by using a name like "Lisbon to Oporto Highway" or something else.3) In the column chosen for type enter 1 for a major highway, 3 for Other highway and so one. You should know these numbers from MapEdit. Note that if, instead, you type 0x0001 0x0003 to specify the type of roads, Excels does not save them (may be there is a workaround but I do not know! also I do not know why I can not create a new field to specify the type of roads! anybody knows why Excel fails on these?). If you leave a row blank, it will be loaded as type equal to "Unknown". You can, later in MapEdit, select all "Unknown" roads and deleted in a single stroke. Save the dBAse file in DBF format. May be you should open again with Excel to see if your changes are there ;).4) Now that you have edited you database, import the Shape file into MapEdit. In Step 1, "Select type of Objects", choose "From Field" and click on the field that you used to specify the road type. Than finish as you described. Do not forget to tell that you want to import the lables if you have and want them!5) Then Save as a MP file. Close MapEdit.6) Then Append MP in SBuilder. Now you can append all at once or one type per turn.Final comment: this tip depends on how easy it is for you to manipulate the Excel file to specify the roads. It may be the case that the database contains already one field with the "type" in a different form and what you only need to do is just a "find & replace". If that is not the case, may be you need to specify the type in a different way. Then, it depends on the tool that you use.I hope you can generate your scenery full of roads :-).Luis

Share this post


Link to post
Share on other sites

Hi Luis. Very good information.The Tiger files have a data column titled FETYPE, that I found unused for Raillines. I looked at the railroad TIGER data.In Excel, I was able to store info into FETYPE in the format of 0x0014 ( which I used for Raillines from column CFCC2, value B1 ), and 0x000c ( which I used for sidetracks column CFCC2, value B2 ). I save the data as MyRails.dbf, and copied the other 2 SHP files as MyRails.shp and MyRails.shxMyRails.shp imported to GPSMapEdit just fine. I was then able to select either type as you indicated above, from the field FETYPE. You can select a type ( say 0x0014 ), and delete it... then save the remainder ( type 0x000c ) as MySidetracks.mpClose the shp file, then reload, repeat the procedure, this time selecting and deleting the 0x000c...leaving 0x0014 to save as MyRaillines.mpI now have 2 types of raillines: MySidetracks.mp, and MyRaillines.mp, in 2 different MP files.This actually works pretty good.Dick

Share this post


Link to post
Share on other sites

Hi Dick.The process is actually simpler than what I wrote above. There is no need to delete and save as above. The whole works can be saved as an MP file, after the Excel editing, and line types appended separately ( with separate VTP2 properties ) from within SBuilder. Luis really did a good job with the append function for the Polish MP files.Dick

Share this post


Link to post
Share on other sites

Hi Dick, Horst, and others.I tried the DBF manipulation with OpenOffice: http://www.openoffice.org/ The DBF loads and can be manipulated fine as a spreadsheet.OpenOffice is a suite of tools that parallels the functions of Microsoft Office. It is free, and great for those not having the funds to buy MS office. It's open source, originally from the Sun Corporation.Using it, I noted why Luis had problems filling a cell with a 0x0000 format... the header for column FETYPE, in my above example is actually in the form of :FETYPE,C,4Change this to:FETYPE,C,6allows the use of 6 characters in the string. :)OpenOffice has a document writer ( like MS Word ), spreadsheet ( like excel ), can use StarBasic within these for Macro use, Can read and write MS compatible files, HTML writer/editor, drawing program, presentation program. Powerful application. Free.Dick

Share this post


Link to post
Share on other sites
Guest vlada stoje

Hi all,thanks Dick for the pointing out of the free fGIS. There is possible also another way, how to split the shapefile into chosen subsections. There is possible (in Search) to build the querry and let select the result of the searching.In the next step, there is possible export chosen layer, with the option

Share this post


Link to post
Share on other sites

I used Excel to change the spec for a road. Removed all uneeded lines - 99% of the data was removed. Exported in DBF format. When loading the new shp, shx,dbf set of files into MapEdit the entire set of lines reappeared. So dbf only provides specifications, not actual line constructs.Then tried editing the bad road in MapEdit and that was not too bad since you can select, and hold" each segment with a click-shift-key combo. Easy to modify the type. Followed Horst's steps. However there is no way that I can see to used ONLY the modified road when creating the Polish MP file for subsequent use in SBuilder. The shape file covers an entire county and thus many duplicate uneeded roads.Dick Boley @KLBE


regards,

Dick near Pittsburgh, USA

Share this post


Link to post
Share on other sites
Guest luissa

Hi,You may have, say, 1000 rows. In the column used for the type you enter, say, 1 in all 1000 rows except 2 on, say, row 432. Or you may leave all blank (type=unknown) except row 432 which will be classified s 2.In MapEdit you will ger all the 1000 items. But if you select by type and specify 2, then, if you do Copy, only item 432 will be copied. Then, you can run another, empty, MapEdit, and Paste. In this second map you will only have row 432.But, there is no need for this 2nd window. In the append dialogue of SBuilder you specify type 2 ON and all the other OFF. In conclusion: the dbf editing is good if you can organize a field (column) which classifies all your 1000 items. You may have, say, 3 types of rivers, 4 types of roads, 1 type for railways and so on. MapEdit will load all of them but they are organized.Regards, Luis

Share this post


Link to post
Share on other sites

OK, followed your instructions. Able to easily select the pieces of the road I want to modify. Set them to Major Highway and selected. Copy - Paste to screen after closing/savig original. Saved the copied screen as Polish. Loaded into SBuilder and worked ok!! Did similar operation with fGIS but much more awkward select process.Thanks,Dick Boley @KLBE


regards,

Dick near Pittsburgh, USA

Share this post


Link to post
Share on other sites

FWIW, what I have been doing is using a field in the DBF that is formated with decimal 0-9999. Then importing into mapedit and saving. Mapedit won't allow you to pick layers, but will preserve the attributes as hex data. Then use a find/replace in a text editor on the .mp file to convert attributes into values that are used in the sbuilder rgn40 or rgn80 files, for lines and polys. On the append sbuilder will ignore all unchecked attribute values. I experimented with editing the rgn80 file to match my attribute data, but sbuilder didn't like that, or at least it wouldn't recognize values over 0x100.scott s..

Share this post


Link to post
Share on other sites
Guest luissa

>unchecked attribute values. I experimented with editing the>rgn80 file to match my attribute data, but sbuilder didn't>like that, or at least it wouldn't recognize values over>0x100.Hi Scott,SBuilder should allow up to 150 line entries in rgn40.txt and rgn80.txt. Actually it starts as if there were 150 lines in these files. Then it reads the files and resets NumberOfRegions40 and NumberOfRegions80 to the numbers of text lines found in the files.Regards, Luis

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...