├── CNAME ├── CODE_OF_CONDUCT.md ├── README.md ├── compare.html ├── css └── styles.css ├── images ├── CustomShapeFileRealLogo.jpg ├── ban-shapefile.png ├── csv.png ├── geojsonicon_400x400.png ├── geopkg.png ├── gml-sticker-tag-open.jpg ├── icon.ico ├── kml.png ├── prefer-geopackage.png └── spatialite-logo.png ├── index.html └── testsuite ├── README.md ├── bin └── runtests.py ├── killtheshapefile └── __init__.py └── outputs └── stats.json /CNAME: -------------------------------------------------------------------------------- 1 | switchfromshapefile.org -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. 6 | 7 | ## Our Standards 8 | 9 | Examples of behavior that contributes to creating a positive environment include: 10 | 11 | * Using welcoming and inclusive language 12 | * Being respectful of differing viewpoints and experiences 13 | * Gracefully accepting constructive criticism 14 | * Focusing on what is best for the community 15 | * Showing empathy towards other community members 16 | 17 | Examples of unacceptable behavior by participants include: 18 | 19 | * The use of sexualized language or imagery and unwelcome sexual attention or advances 20 | * Trolling, insulting/derogatory comments, and personal or political attacks 21 | * Public or private harassment 22 | * Publishing others' private information, such as a physical or electronic address, without explicit permission 23 | * Other conduct which could reasonably be considered inappropriate in a professional setting 24 | 25 | ## Our Responsibilities 26 | 27 | Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. 28 | 29 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. 30 | 31 | ## Scope 32 | 33 | This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. 34 | 35 | ## Enforcement 36 | 37 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at info@opengeolabs.cz. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. 38 | 39 | Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. 40 | 41 | ## Attribution 42 | 43 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] 44 | 45 | [homepage]: http://contributor-covenant.org 46 | [version]: http://contributor-covenant.org/version/1/4/ 47 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # shapefilemustdie 2 | 3 | Repository with source code of the web page http://switchfromshapefile.org 4 | 5 | ## Contributing 6 | 7 | Contribute by sending standard pull request to `gh-pages` branch 8 | 9 | ## License 10 | 11 | Creative commons share alike 12 | -------------------------------------------------------------------------------- /compare.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | 6 | 7 |29 |
30 | 31 |ogrinfo
on various types of tasks. Each task is
48 | running using Python timeit
50 | module.
51 | 52 | from timeit import timeit 53 | time = timeit( 54 | """subprocess.run(["ogrinfo", "more", "params"], 55 | stdout=subprocess.PIPE)""") 56 |57 |
59 | NOTE: Graphs are using only GeoPackage vs. Shapefile 60 | times. It was not possible to work with GeoJSON in size of 4GB. GML proofed 61 | to be working, but the times were generally very slow, it was meaning less 62 | to visualise them. 63 |
64 |73 | It was measured on an EC2 c5a.4xlarge instance (SSD, 32GB RAM, AMD® Epyc 7r32 16 cores) 74 |
75 | 76 |80 |
81 | 82 | 83 |
87 | Test time, till all features are read sequentially using simple
88 | ogrinfo
command.
89 |
90 | ogrinfo gis.osm_buildings_a_free_1.shp gis.osm_buildings_a_free_1 91 |92 | 93 | 94 |
98 | Test time, till file metadata are displayed using
99 | ogrinfo
command.
100 |
101 | ogrinfo -so \ 102 | gis.osm_buildings_a_free_1.shp gis.osm_buildings_a_free_1 103 |104 | 105 | 106 |
110 | Test time, till feature with given fid
is
111 | identified using ogrinfo
command.
112 |
113 | ogrinfo -fid 63347 \ 114 | gis.osm_buildings_a_free_1.shp gis.osm_buildings_a_free_1 115 |116 | 117 | 118 |
122 | Test time, till feature with given spat
condition
123 | is identified using ogrinfo
command.
124 |
125 | ogrinfo -spat 5.421254 52.129629 5.421254 52.129629 \ 126 | gis.osm_buildings_a_free_1.shp gis.osm_buildings_a_free_1 127 |128 | 129 | 130 |
134 | Test time, till feature with given where
condition
135 | is identified using ogrinfo
command.
136 |
137 | ogrinfo -where "name='OBS De Hobbit'" \ 138 | gis.osm_buildings_a_free_1.shp gis.osm_buildings_a_free_1 139 |140 | 141 | 142 |
145 | Last modification: 2017-10-22
146 | Initially created by: Jachym Cepicky,
147 | OpenGeoLabs s.r.o.
148 |
149 |
150 |
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License
151 | Contribute: On GitHub
152 |
33 | ESRI 34 | Shapefile is a file format for 36 | storing geospatial vector data. It has been around since the early 37 | 1990s and is still the most commonly used vector data exchange format. 38 |
39 |While Shapefiles have enabled many successful activities over the years, they also 40 | have a number of limitations that complicate software development and reduce efficiency. 41 |
42 |43 | We, members of the geospatial IT industry, believe that it is time to stop using Shapefiles 44 | as the primary vector data exchange format and to replace them with a format that takes 45 | advantage of the huge advances that have been made since Shapefile was introduced. 46 |
47 |Read more:
48 |58 | Shapefile does a lot of things right. 59 | Here are some reasons why Shapefile is so heavily used: 60 |
61 |Why is Shapefile so bad? Here are several reasons why the Shapefile is a 82 | bad format and you should avoid its usage:
83 | 84 |
123 | By default there is no definition of the coordinate reference system
124 | used. You can do it using e.g. .prj
, but first: this is not
125 | standard part of the specification and second, there are still some
126 | issues, see projection issues and multifile format more lower.
128 |
135 | The Shapefile format uses at least 3 137 | files (*.shp, *.dbf, *.shx). Users cannot share just one file; you 138 | must send them all. Users typically zip all the files into one archive 139 | and unzip them on the other end of the distribution chain, but this is 140 | cumbersome and error-prone. 141 |
142 |143 | In addition, other geospatial software packages routinely add their own 144 | extensions to try to overcome Shapefile limitations. Custom additions 145 | are not supported by other tools and limit interoperability. 146 |
147 |148 | NOTE: 3rd December is considered the International Shapefile day, 149 | because thanks to modular, extensible architecture it can have 12+ sidecar files, 3 of which are mandatory. 150 |
151 |157 | Attribute names are limited to 10 characters max. Longer names 158 | are usually automatically shortened. This leads to abbreviated and/or 159 | cryptic attribute names that are unintuitive to the recipient of the 160 | data. 161 |
162 |168 | There can be only 255 attribute fields in the database file. For some 169 | applications this is limiting, especially in combination with the flat table structure. 171 |
172 |178 | Float, integer, date and character string data types are supported. 179 | Floating point numbers can be stored as text, but there is no support for big 180 | integers (thus the format is not usable, you have data with big 181 | integer identifiers, such as cadastral maps) and the text is limited to only 182 | 254 characters. 183 |
184 |185 | There is no support for more advanced data fields such as blobs, images 186 | or arrays. 187 |
188 |194 | There is no way to specify the character set used in the database. Many 195 | applications are using the old Windows-* or ISO-* data encodings, 196 | while nowadays we are tending to use UTF-8 more. Still there is no way to specify 197 | this in file header. 198 |
199 |200 | The support for Unicode characters is also very limited. 201 |
202 |209 | The size of both .shp and .dbf component files cannot exceed 2 GB. GDAL Shapefile driver 211 | overcomes this limit, but 212 |
213 | 214 |222 | 223 |The Shapefile format explicitly uses 32bit offsets and so cannot go 215 | over 8GB (it actually uses 32bit offsets to 16bit words), but the OGR shapefile 216 | implementation has a limitation of 4GB. 217 |
218 |219 | For compatibility with other software implementations, it is not recommended to use a file size over 2GB for both .SHP and .DBF files. 220 |
221 |
So 4GB is all you can have in single Shapefile. This sounds enough, 224 | but not for all cases.
225 |231 | Shapefile is simple-feature format. There is no way to store more 232 | complex geometry relationships. 233 |
234 |240 | Each file can be only one of the supported geometry formats (Point, 241 | Line, Polygon and others). Mixed geometry features are not possible. 242 |
243 |249 | The data structure is limited to flat tables with no 250 | hierarchies, relations or tree structure. 251 |
252 |258 | Shapefile can't store material definitions nor textures (images 259 | with texture coordinates). 3D models are stored as a triangle or 260 | polygon soup, with no watertight models or parametric geometries 261 | being supported. 262 |
263 |
269 | By default, Shapefile contains no information about coordinate reference
270 | system at all. But some software packages do accept *.prj
271 | files, which may contain CRS description.
272 |
274 | It uses Esri WKT definitions, which are often incompatible 275 | with standard definitions in EPSG or other sources regarding aspects such 276 | as axis order or unit definitions. Furthermore, they often miss 277 | parameters required for reprojection ("Missing Bursa Wolf 278 | Parameters", anyone?) 279 |
280 |287 | Line and polygon geometry type, single or multipart, cannot be reliably 288 | determined at the layer level, it must be determined at the 289 | individual feature level. This leads to incositancy during automatic data processing, you can not relay on input geometry type and test each feature, whether it is single geometry or multiple geometries. 290 |
291 |297 | There is no way to mark no data in a field of the attribute table. 298 | You cannot distingues zero and no data for numerical fields.
299 |305 | Do you know about more limits or do you want to extend existing ones? 306 | Please do so via pull-request or comment in the 308 | repository. 309 |
310 |317 | What are the alternatives to the Shapefile format? To be honest, no alternative 318 | format has overthrown the Shapefile hegemony yet. Some formats nearly 319 | took over (KML, GML, GeoJSON), but their usage was limited to relatively 320 | narrow use cases only. 321 |
322 |323 | Although there are more then 324 | 80 vector data formats in use out there, only a few can be 325 | considered as candidates for Shapefile replacement. Please note, that we do 326 | take only open (preferably community) formats into account. 327 |
328 | List of some Shapefile alternatives 329 |339 | 340 | 341 |https://t.co/6JZZRiP8q5 featuring two formats as @shapefile replacement. Which do you prefer? #switchfromshapefile #geojson vs. #geopackage
— Jachym Cepicky (@jachymc) October 5, 2017
349 | OGC GeoPackage is one of the most 350 | promising formats, designed for today's modern applications. GeoPackage is 351 | published as standard by the Open 352 | Geospatial Consortium. 353 |
354 |364 | GeoPackage is an open, standards-based, platform-independent, portable, 365 | self-describing, compact format for transferring geospatial information. 366 |
367 |368 | The GeoPackage Encoding Standard describes a set of conventions for storing 369 | the following within an SQLite database: 370 |
371 |379 | There are several published extensions 380 | for GeoPackage which make this format even more powerful. 381 |
382 |383 | GeoPackage is now (2017) supported in most GIS software packages. 384 |
385 |One downside to GeoPackage is that the underlying SQLite database 386 | is a complex binary format that is not suitable for streaming. 387 | It either must be written to the local file system or accessed 388 | through an intermediary service. 389 |
390 |We recommend GeoPackage as a Shapefile replacement for 391 | scenarios where the recipient will want to query or edit the 392 | data locally. 393 |
394 |401 | FlatGeobuf is a new format, designed for performance and simplicity. 402 |
403 |412 | FlatGeobuf is an open, standards-based, platform-independent, portable, self-describing, performant and compact format for transferring geospatial information. 413 |
414 |415 | FlatGeobuf is currently (2020) supported in GDAL 3.1 and QGIS 3.16. 416 | Reference TypeScript/JavaScript implementation is available and suitable for use in for example OpenLayers and Leaflet. 417 |
418 |We recommend FlatGeobuf as a Shapefile replacement for 419 | scenarios where performance is critical and system to system integrations. 420 | Because of the streaming capabilities it is also suitable as an alternative WFS output format 421 | and is available as an official extension to GeoServer. 422 |
423 |430 |
"GeoJSON isn't a shapefile replacement."432 | GeoJSON is a community format based on the 433 | popular JSON data exchange format. 434 | 435 | 436 |
431 | -- Sean Gillies
GeoJSON is very simple, human-readable, text-based format. Although it 447 | is technically possible to use it with more coordinate reference 448 | systems, the specification 449 | states clearly, that WGS84 is the only system, which 450 | should be used. It can handle complex vector data 451 | features and build complex hierarchical data models. 452 |
453 |Since GeoJSON is a JSON encoding it is very easy to parse. 454 | It also supports streaming (features are dealt with as they come in without waiting for the whole file to load).
455 |456 | The problem with GeoJSON is that not all geometries can be represented and advanced coordinate reference systems are not well supported.
457 |We recommend GeoJSON as a Shapefile replacement for data interchange particularly for web services. For datasets with 458 | geometries or coordinate reference systems not representable in GeoJSON, GML may be suitable. 459 |
460 |466 | Another OGC Standard. 467 |
468 |477 | GML was picked as the main distribution vector data format the European 478 | INSPIRE initiative. It's a very complex format, and its direct usage in 479 | GIS software is limited. Its main use is as a data exchange format that needs to be 480 | ingested into the user's system (e.g. into a database) to be fully usable. 481 |
482 |483 | GML is currently often used for open data datasets, since it is 484 | technology-neutral and a supported OGC Standard. 485 |
486 |A major downside to GML is that it is an insanely complex standard. 487 | Few software packages support the entire standard and support for individual parts of the standard varies widely.
488 |489 | We believe that GML is a candidate for Shapefile 490 | replacement for data interchange in situations where data is too complex to be represented by GeoJSON. 491 | However, for the vast majority of datasets GML is overkill. 492 |
493 |500 | SpatiaLite 501 | is popular database, file based data storage. 502 |
503 |511 | SpatiaLite is an open source library intended to extend the SQLite core 512 | to support fully fledged Spatial SQL capabilities. 513 | SQLite is intrinsically simple and lightweight: 514 |
515 |525 | Support for SpatiaLite is relatively limited and most software 526 | that supports SpatiaLite also supports GeoPackage as well. They build on top of 528 | the same underlying technology, SQLite. 529 |
530 | SpatialLite lacks the support for extensions or raster data 531 | present in GeoPackage. While these are not necessarily must-have 532 | features, they may be useful. Like GeoPackage, it is unsuitable 533 | for streaming. 534 | 535 |536 | Since SpatiaLite offers no clear advantages over GeoPackage at 537 | this time, it should only be considered as a Shapefile 538 | replacement in niche scenarios. 539 |
540 |548 | Some people tend to use comma 549 | separated files for storing geospatial data. 550 |
551 |558 | Among non-geospatial people, CSV is very popular, but for most 559 | geospatial applications it is not an ideal format. 560 |
561 |562 | At least two reasons for not using CSV as Shapefile replacement: It isn't 563 | standardized (there are many dialects out there) and support for non-point 564 | geospatial data is complicated. 565 |
566 |573 | OGC KML was a popular 574 | popular vector data format due to the popularity of Google Earth. 575 |
576 |585 | KML was originally devised as the exchange format for a software package called 586 | Keyhole. When Google purchased Keyhole and released it as Google Earth, KML 587 | gained in popularity. However, as the geospatial community hit the limits of 588 | both Google Earth and KML, KML's popularity has waned. Since it is XML based, it is not efficient 589 | for storing larger datasets. It combines cartography along with the data geometry in one 590 | file, which is problematic when the data has the potential to be used in multiple 591 | ways. Since it officially supports only the WGS-84 coordinate reference system, 592 | it is not suitable for a number of applications. 593 |
594 |601 | At its most basic level, an 602 | ArcGIS geodatabase is a collection of geographic 603 | datasets of various types held in a common file system folder, a Microsoft 604 | Access database, or a multiuser relational DBMS (such as Oracle, Microsoft 605 | SQL Server, PostgreSQL, Informix, or IBM DB2). 606 |
607 |616 | GeoDatabase is very often used in the ArcGIS environment as the main 617 | exchange data format. Its features are very complex and advanced. 618 |
619 |620 | On the other hand, since it is a proprietary closed format, implementations 621 | outside the environment of ESRI products are extremely limited. It is only a 622 | candidate for replacing Shapefiles in an enviroment centered on ArcGIS. 623 |
624 |
630 | Last modification: 2017-10-08
631 | Initially created by: Jachym Cepicky,
632 | OpenGeoLabs s.r.o.
633 |
634 |
635 |
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License
636 | Contribute: On GitHub
637 |