SHAPE存储格式说明.docx
- 文档编号:28785173
- 上传时间:2023-07-19
- 格式:DOCX
- 页数:110
- 大小:104.07KB
SHAPE存储格式说明.docx
《SHAPE存储格式说明.docx》由会员分享,可在线阅读,更多相关《SHAPE存储格式说明.docx(110页珍藏版)》请在冰豆网上搜索。
SHAPE存储格式说明
ESRIShapefileTechnicalDescription
AnESRIWhitePaper—July1998
Copyright©1997,1998EnvironmentalSystemsResearchInstitute,Inc.
Allrightsreserved.
PrintedintheUnitedStatesofAmerica.
TheinformationcontainedinthisdocumentistheexclusivepropertyofEnvironmentalSystemsResearchInstitute,Inc.
ThisworkisprotectedunderUnitedStatescopyrightlawandotherinternationalcopyrighttreatiesandconventions.No
partofthisworkmaybereproducedortransmittedinanyformorbyanymeans,electronicormechanical,including
photocopyingandrecording,orbyanyinformationstorageorretrievalsystem,exceptasexpresslypermittedinwriting
byEnvironmentalSystemsResearchInstitute,Inc.AllrequestsshouldbesenttoAttention:
ContractsManager,
EnvironmentalSystemsResearchInstitute,Inc.,380NewYorkStreet,Redlands,CA92373-8100USA.
Theinformationcontainedinthisdocumentissubjecttochangewithoutnotice.
U.S.GOVERNMENTRESTRICTED/LIMITEDRIGHTS
Anysoftware,documentation,and/ordatadeliveredhereunderissubjecttothetermsoftheLicenseAgreement.Inno
eventshalltheGovernmentacquiregreaterthanRESTRICTED/LIMITEDRIGHTS.Ataminimum,use,duplication,or
disclosurebytheGovernmentissubjecttorestrictionsassetforthinFAR§52.227-14AlternatesI,II,andIII(JUN
1987);FAR§52.227-19(JUN1987)and/orFAR§12.211/12.212(CommercialTechnicalData/ComputerSoftware);and
DFARS§252.227-7015(NOV1995)(TechnicalData)and/orDFARS§227.7202(ComputerSoftware),asapplicable.
Contractor/ManufacturerisEnvironmentalSystemsResearchInstitute,Inc.,380NewYorkStreet,Redlands,CA92373-
8100USA.
IntheUnitedStatesandinsomecountries,ARC/INFO,ArcCAD,ArcView,ESRI,andPCARC/INFOareregistered
trademarks;3DAnalyst,ADF,AML,ARCCOGO,ARCGRID,ARCNETWORK,ARCNews,ARCTIN,ARC/INFO,
ARC/INFOLIBRARIAN,ARC/INFO—ProfessionalGIS,ARC/INFO—TheWorld'sGIS,ArcAtlas,ArcBrowser,
ArcCAD,ArcCensus,ArcCity,ArcDoc,ARCEDIT,ArcExplorer,ArcExpress,ARCPLOT,ArcPress,ArcScan,
ArcScene,ArcSchool,ArcSdl,ARCSHELL,ArcStorm,ArcTools,ArcUSA,ArcUser,ArcView,ArcWorld,AtlasGIS,
AtlasWare,Avenue,BusinessMAP,DAK,DATABASEINTEGRATOR,DBIKit,ESRI,ESRI—TeamGIS,ESRI—The
GISPeople,FormEdit,GeographicDesignSystem,GISbyESRI,GISforEveryone,GISDataServer,IMAGE
INTEGRATOR,InsiteMAP,MapCafé,MapObjects,NetEngine,PCARC/INFO,PCARCEDIT,PCARCPLOT,
PCARCSHELL,PCDATACONVERSION,PCNETWORK,PCOVERLAY,PCSTARTERKIT,PCTABLES,SDE,
SML,SpatialDatabaseEngine,StreetMap,TABLES,theARCCOGOlogo,theARCGRIDlogo,theARCNETWORK
logo,theARCTINlogo,theARC/INFOlogo,theArcCADlogo,theArcCADWorkBenchlogo,theArcDataemblem,
theArcDatalogo,theArcDataOnlinelogo,theARCEDITlogo,theArcExplorerlogo,theArcExpresslogo,the
ARCPLOTlogo,theArcPresslogo,theArcPressforArcViewlogo,theArcScanlogo,theArcStormlogo,theArcTools
logo,theArcView3DAnalystlogo,theArcViewDataPublisherlogo,theArcViewGISlogo,theArcViewInternetMap
Serverlogo,theArcViewNetworkAnalystlogo,theArcViewSpatialAnalystlogo,theArcViewStreetMaplogo,the
AtlasGISlogo,theAvenuelogo,theBusinessMAPlogo,theBusinessMAPPROlogo,theCommonDesignMark,the
DAKlogo,theESRIcorporatelogo,theESRIglobelogo,theMapCafélogo,theMapObjectslogo,theMapObjects
InternetMapServerlogo,theNetEnginelogo,thePCARC/INFOlogo,theSDElogo,theSDECADClientlogo,The
World'sLeadingDesktopGIS,ViewMaker,WaterWrites,andYourPersonalGeographicInformationSystemare
trademarks;andArcData,ARCMAIL,ArcOpen,ArcQuest,ArcWatch,ArcWeb,Rent-a-Tech,,and
@areservicemarksofEnvironmentalSystemsResearchInstitute,Inc.
Thenamesofothercompaniesandproductshereinaretrademarksorregisteredtrademarksoftheirrespectivetrademark
owners.
J-7855
ESRIShapefileTechnical
Description
AnESRIWhitePaper
Contents
WhyShapefiles?
ShapefileTechnicalDescription
OrganizationoftheMainFile
MainFileRecordContents
OrganizationoftheIndexFile
OrganizationofthedBASEFile
Glossary
ESRIWhitePaper
Page
1
2
2
5
23
25
26
i
J-7855
ESRIShapefileTechnical
Description
Thisdocumentdefinestheshapefile(.shp)spatialdataformatand
describeswhyshapefilesareimportant.Itliststhetoolsavailablein
EnvironmentalSystemsResearchInstitute,Inc.(ESRI),softwarefor
creatingshapefilesdirectlyorconvertingdataintoshapefilesfromother
formats.Thisdocumentalsoprovidesallthetechnicalinformation
necessaryforwritingacomputerprogramtocreateshapefileswithoutthe
useofESRI®softwarefororganizationsthatwanttowritetheirowndata
translators.
WhyShapefiles?
HowShapefiles
CanBeCreated
Ashapefilestoresnontopologicalgeometryandattributeinformationforthespatial
featuresinadataset.Thegeometryforafeatureisstoredasashapecomprisingasetof
vectorcoordinates.
Becauseshapefilesdonothavetheprocessingoverheadofatopologicaldatastructure,
theyhaveadvantagesoverotherdatasourcessuchasfasterdrawingspeedandedit
ability.Shapefileshandlesinglefeaturesthatoverlaporthatarenoncontiguous.They
alsotypicallyrequirelessdiskspaceandareeasiertoreadandwrite.
Shapefilescansupportpoint,line,andareafeatures.Areafeaturesarerepresentedas
closedloop,double-digitizedpolygons.AttributesareheldinadBASE®formatfile.
Eachattributerecordhasaone-to-onerelationshipwiththeassociatedshaperecord.
Shapefilescanbecreatedwiththefollowingfourgeneralmethods:
ExportShapefilescanbecreatedbyexportinganydatasourcetoashapefileusing
ARC/INFO®,PCARC/INFO®,SpatialDatabaseEngine™(SDE™),ArcView®GIS,
orBusinessMAP™software.
DigitizeShapefilescanbecreateddirectlybydigitizingshapesusingArcViewGIS
featurecreationtools.
ProgrammingUsingAvenue™(ArcViewGIS),MapObjects™,ARCMacro
Language(AML™)(ARC/INFO),orSimpleMacroLanguage(SML™)
(PCARC/INFO)software,youcancreateshapefileswithinyourprograms.
Writedirectlytotheshapefilespecificationsbycreatingaprogram.
ESRIWhitePaper
ESRIShapefileTechnicalDescription
J-7855
SDE,ARC/INFO,PCARC/INFO,DataAutomationKit(DAK™),andArcCAD®
softwareprovideshape-to-coveragedatatranslators,andARC/INFOalsoprovidesa
coverage-to-shapetranslator.Forexchangewithotherdataformats,theshapefile
specificationsarepublishedinthispaper.Otherdatastreams,suchasthosefromglobal
positioningsystem(GPS)receivers,canalsobestoredasshapefilesorX,Yeventtables.
ShapefileTechnical
Description
NamingConventions
Examples
NumericTypes
Organizationofthe
MainFile
Computerprogramscanbecreatedtoreadorwriteshapefilesusingthetechnical
specificationinthissection.
AnESRIshapefileconsistsofamainfile,anindexfile,andadBASEtable.Themain
fileisadirectaccess,variable-record-lengthfileinwhicheachrecorddescribesashape
withalistofitsvertices.Intheindexfile,eachrecordcontainstheoffsetofthe
correspondingmainfilerecordfromthebeginningofthemainfile.ThedBASEtable
containsfeatureattributeswithonerecordperfeature.Theone-to-onerelationship
betweengeometryandattributesisbasedonrecordnumber.Attributerecordsinthe
dBASEfilemustbeinthesameorderasrecordsinthemainfile.
Allfilenamesadheretothe8.3namingconvention.Themainfile,theindexfile,andthe
dBASEfilehavethesameprefix.Theprefixmuststartwithanalphanumericcharacter
(a–Z,0–9),followedbyzerooruptosevencharacters(a–Z,0–9,_,-).Thesuffixfor
themainfileis.shp.Thesuffixfortheindexfileis.shx.ThesuffixforthedBASEtable
is.dbf.Alllettersinafilenameareinlowercaseonoperatingsystemswithcase
sensitivefilenames.
Mainfile:
counties.shp
Indexfile:
counties.shx
dBASEtable:
counties.dbf
Ashapefilestoresintegeranddouble-precisionnumbers.Theremainderofthisdocument
willrefertothefollowingtypes:
Integer:
Signed32-bitinteger(4bytes)
Double:
Signed64-bitIEEEdouble-precisionfloatingpointnumber(8bytes)
Floatingpointnumbersmustbenumericvalues.Positiveinfinity,negativeinfinity,and
Not-a-Number(NaN)valuesarenotallowedinshapefiles.Nevertheless,shapefiles
supporttheconceptof"nodata"values,buttheyarecurrentlyusedonlyformeasures.
38
representa"nodata"value.
Thefirstsectionbelowdescribesthegeneralstructureandorganizationoftheshapefile.
Thesecondsectiondescribestherecordcontentsforeachtypeofshapesupportedinthe
shapefile.
Themainfile(.shp)containsafixed-lengthfileheaderfollowedbyvariable-length
records.Eachvariable-lengthrecordismadeupofafixed-lengthrecordheaderfollowed
byvariable-lengthrecordcontents.Figure1illustratesthemainfileorganization.
March1998
2
Anyfloatingpointnumbersmallerthan–10isconsideredbyashapefilereaderto
ESRIShapefileTechnicalDescription
J-7855
Figure1
OrganizationoftheMainFile
FileHeader
RecordHeader
RecordHeader
RecordHeader
RecordHeader
...
...
RecordHeader
RecordContents
RecordContents
RecordContents
RecordContents
RecordContents
ByteOrder
Allthecontentsinashapefilecanbedividedintotwocategories:
Datarelated
∙
∙
Mainfilerecordcontents
Mainfileheader’sdatadescriptionfields(ShapeType,BoundingBox,etc.)
Filemanagementrelated
∙
∙
Fileandrecordlengths
Recordoffsets,
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- SHAPE 存储 格式 说明