René's URL Explorer Experiment


Title: Default field size and decimal length when writing shapefiles · Issue #114 · GeospatialPython/pyshp · GitHub

Open Graph Title: Default field size and decimal length when writing shapefiles · Issue #114 · GeospatialPython/pyshp

X Title: Default field size and decimal length when writing shapefiles · Issue #114 · GeospatialPython/pyshp

Description: Due to recent changes since 1.2.10, the issue of field and value types have been raised as a concern by several users. Most recently, @klasko2 pointed out in #99 that saving a float value to an 'F' field will save it as an integer, becau...

Open Graph Description: Due to recent changes since 1.2.10, the issue of field and value types have been raised as a concern by several users. Most recently, @klasko2 pointed out in #99 that saving a float value to an 'F'...

X Description: Due to recent changes since 1.2.10, the issue of field and value types have been raised as a concern by several users. Most recently, @klasko2 pointed out in #99 that saving a float value to an ...

Opengraph URL: https://github.com/GeospatialPython/pyshp/issues/114

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Default field size and decimal length when writing shapefiles","articleBody":"Due to recent changes since 1.2.10, the issue of field and value types have been raised as a concern by several users. Most recently, @klasko2 pointed out in #99 that saving a float value to an 'F' field will save it as an integer, because the default number of decimals is 0 when defining a new field. This begs the more general question for the next version of PyShp: \r\n\r\n**What should be the default field 'size' and 'decimal' for different field types?** \r\n\r\nI hope this thread can be used as a place for people to voice their concerns and share their experiences and expectations regarding shapefiles and dbf field types. \r\n\r\n# The Issue\r\n\r\nUntil now, field size (i.e. how many bytes) has been always set to 50, and decimal always to 0. \r\nInstead, I think the case can be made that **any numeric field should default to a decimal number**. This leaves us with some open questions: \r\n\r\n1. **...what's a good default size number?** Is 50 big enough to store most numbers that an average user would need and at the same time small enough to not waste filesize. For a negative decimal number, this could store a value as low as `-100000000000000000000000000000000000000000000000.0`, or as detailed as `-0.000000000000000000000000000000000000000000000001` (provided the decimal arg is set accordingly)? That might actually seem excessively high for most users so perhaps it should be lowered to produce smaller shapefiles? What's the default in other software? \r\n2. **...what's a good default decimal number?** Would 6 decimal places retain enough information for the average user not to feel they are losing information? This would mean floats being rounded to e.g. `0.123456`. Perhaps this is too small, should it be instead 12 or 16? What's the default in other software? \r\n3. **...should size and decimal be the same for 'F' and 'N' fields?** Float fields are decimals by definition, but Numeric fields can be both ints or floats. One might argue that both should default to decimal numbers, since defaulting to ints would result in lost information for unsuspecting users. Manually setting decimal=0 can be done if the user is certain they just want to save ints. \r\n\r\nFor the remaining field types I think the following would be non-controversial:\r\n- Type 'C': size=80, decimal irrelevant. Text fields are typically longer than numeric fields, and I believe that's the default QGIS text field size. This would save text values as long as `abcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcde`.\r\n- Type 'L': size=1, decimal irrelevant. \r\n- Type 'D': size=8, decimal irrelevant. \r\n\r\nAny and all thoughts are appreciated! \r\n","author":{"url":"https://github.com/karimbahgat","@type":"Person","name":"karimbahgat"},"datePublished":"2017-08-29T16:07:42Z","url":"https://github.com/GeospatialPython/pyshp/issues/114"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:e0145b3f-dbd7-1c3a-d347-4a8c9df2c86c
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idD2B2:DC070:43677B:5E9DDF:6B00709E
html-safe-nonce1dcfb14e4b9c86254a9850b471832d692fdc24474db40738696bf3f5fdfc0a8e
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMkIyOkRDMDcwOjQzNjc3Qjo1RTlEREY6NkIwMDcwOUUiLCJ2aXNpdG9yX2lkIjoiMzQwMDQxMjkyNjcyMzUxODYyMiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacd1fd346429b853b9a535eeaf4baa1093dd98b59c0cf38d5cc50253e269899453
hovercard-subject-tagissue:253720773
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/GeospatialPython/pyshp/114/issue_layout
twitter:imagehttps://opengraph.githubassets.com/bdcca97f4292e8ef93e2bb87d0ee637a273bdc39470ebfe8fa37919cdf4192ae/GeospatialPython/pyshp/issues/114
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/bdcca97f4292e8ef93e2bb87d0ee637a273bdc39470ebfe8fa37919cdf4192ae/GeospatialPython/pyshp/issues/114
og:image:altDue to recent changes since 1.2.10, the issue of field and value types have been raised as a concern by several users. Most recently, @klasko2 pointed out in #99 that saving a float value to an 'F'...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamekarimbahgat
hostnamegithub.com
expected-hostnamegithub.com
None6527e91c60c0b29d16606ff32ac5df8ecdc37a2a62205ea057a14d7762c870fa
turbo-cache-controlno-preview
go-importgithub.com/GeospatialPython/pyshp git https://github.com/GeospatialPython/pyshp.git
octolytics-dimension-user_id5385450
octolytics-dimension-user_loginGeospatialPython
octolytics-dimension-repository_id17410607
octolytics-dimension-repository_nwoGeospatialPython/pyshp
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id17410607
octolytics-dimension-repository_network_root_nwoGeospatialPython/pyshp
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release46f1cd2ae3cd8ae1a81019b5d619742e76f13bbd
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/GeospatialPython/pyshp/issues/114#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FGeospatialPython%2Fpyshp%2Fissues%2F114
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FGeospatialPython%2Fpyshp%2Fissues%2F114
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=GeospatialPython%2Fpyshp
Reloadhttps://github.com/GeospatialPython/pyshp/issues/114
Reloadhttps://github.com/GeospatialPython/pyshp/issues/114
Reloadhttps://github.com/GeospatialPython/pyshp/issues/114
GeospatialPythonhttps://github.com/GeospatialPython
pyshphttps://github.com/GeospatialPython/pyshp
Codehttps://github.com/GeospatialPython/pyshp
Issues8 (8)https://github.com/GeospatialPython/pyshp/issues
Pull requestshttps://github.com/GeospatialPython/pyshp/pulls
Discussionshttps://github.com/GeospatialPython/pyshp/discussions
Actionshttps://github.com/GeospatialPython/pyshp/actions
Projectshttps://github.com/GeospatialPython/pyshp/projects
Wikihttps://github.com/GeospatialPython/pyshp/wiki
Security and qualityhttps://github.com/GeospatialPython/pyshp/security
Insightshttps://github.com/GeospatialPython/pyshp/pulse
https://github.com/GeospatialPython/pyshp
New issuehttps://github.com/login?return_to=https://github.com/GeospatialPython/pyshp/issues/114
New issuehttps://github.com/login?return_to=https://github.com/GeospatialPython/pyshp/issues/114
Default field size and decimal length when writing shapefileshttps://github.com/GeospatialPython/pyshp/issues/114#top
enhancementhttps://github.com/GeospatialPython/pyshp/issues?q=state%3Aopen%20label%3A%22enhancement%22
questionhttps://github.com/GeospatialPython/pyshp/issues?q=state%3Aopen%20label%3A%22question%22
Produce smaller dbf files by auto detecting field sizehttps://github.com/GeospatialPython/pyshp/milestone/1
https://github.com/karimbahgat
karimbahgathttps://github.com/karimbahgat
on Aug 29, 2017https://github.com/GeospatialPython/pyshp/issues/114#issue-253720773
#99https://github.com/GeospatialPython/pyshp/issues/99
karimbahgathttps://github.com/karimbahgat
questionhttps://github.com/GeospatialPython/pyshp/issues?q=state%3Aopen%20label%3A%22question%22
on Aug 29, 2017https://github.com/GeospatialPython/pyshp/issues/114#event-1225982429
karimbahgathttps://github.com/karimbahgat
enhancementhttps://github.com/GeospatialPython/pyshp/issues?q=state%3Aopen%20label%3A%22enhancement%22
on Jan 14, 2021https://github.com/GeospatialPython/pyshp/issues/114#event-4206202923
karimbahgathttps://github.com/karimbahgat
Produce smaller dbf files by auto detecting field sizehttps://github.com/GeospatialPython/pyshp/milestone/1
on Jan 27, 2022https://github.com/GeospatialPython/pyshp/issues/114#event-5962584920
https://github.com/ChrisBarker-NOAA
ChrisBarker-NOAAhttps://github.com/ChrisBarker-NOAA
on Nov 22, 2023https://github.com/GeospatialPython/pyshp/issues/114#issuecomment-1822058340
http://www.manmrk.net/tutorials/database/xbase/data_types.html#DATA_TYPEShttp://www.manmrk.net/tutorials/database/xbase/data_types.html#DATA_TYPES
https://github.com/ChrisBarker-NOAA
ChrisBarker-NOAAhttps://github.com/ChrisBarker-NOAA
on Nov 22, 2023https://github.com/GeospatialPython/pyshp/issues/114#issuecomment-1823184687
https://gdal.org/drivers/vector/shapefile.htmlhttps://gdal.org/drivers/vector/shapefile.html
https://github.com/JamesParrott
JamesParrotthttps://github.com/JamesParrott
on Jun 20, 2026https://github.com/GeospatialPython/pyshp/issues/114#issuecomment-4759736348
@ChrisBarker-NOAAhttps://github.com/ChrisBarker-NOAA
https://github.com/ChrisBarker-NOAA
ChrisBarker-NOAAhttps://github.com/ChrisBarker-NOAA
on Jun 22, 2026https://github.com/GeospatialPython/pyshp/issues/114#issuecomment-4773623155
https://github.com/JamesParrott
JamesParrotthttps://github.com/JamesParrott
on Jun 23, 2026https://github.com/GeospatialPython/pyshp/issues/114#issuecomment-4777028145
.db7https://dbase.com/Knowledgebase/int/db7_file_fmt.htm
.dbf (v5)https://en.wikipedia.org/wiki/.dbf#Database_records
Sign up for freehttps://github.com/signup?return_to=https://github.com/GeospatialPython/pyshp/issues/114
Sign in to commenthttps://github.com/login?return_to=https://github.com/GeospatialPython/pyshp/issues/114
enhancementhttps://github.com/GeospatialPython/pyshp/issues?q=state%3Aopen%20label%3A%22enhancement%22
questionhttps://github.com/GeospatialPython/pyshp/issues?q=state%3Aopen%20label%3A%22question%22
Produce smaller dbf files by auto detecting field sizehttps://github.com/GeospatialPython/pyshp/milestone/1
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.