SlideShare ist ein Scribd-Unternehmen logo
1 von 32
Downloaden Sie, um offline zu lesen
Simplifying & Rectifying
a SHP Linestring Layer
by Giuliano Curti (giulianc51 at gmail dot com)
Gennaio 2014

While I was interested in my ideas about 3D data
in QGIS I met the contour lines....

v. 2014-02-01
my initial intention was to clean the lines (obtained from DEM)
from the flurry of points;
when I planned this script I did not know that the job were
already possible in QGIS with the help of fTools;
I knew even less about the Ramer-Douglas-Peucker
algorithm used by fTools.
At the discovery of my error, reported to me by a friend of the
Italian GFOSS mailing list, I wanted to compare my game
procedure with that of fTools, finding that my script behaved
well all things considered: in one test case my script was
cleaning the lines from the original 46k vertices at only 10711,
compared to 10716 of QGIS / fTools.
5 out of 11k are almost a trivial problem, even
though I was intrigued so I wanted to investigate;
with the help of Spatialite I have identified 5 points
that appeared in fTools and not in my result;
some points were caused by different threshold
used, but other do not and I discovered something
interesting:
a small flaw in the RDP algorithm !
look at the next slide:
This is an original line (look at how many
red crosses indicating the number of vertices
this is the same line cleaned with
fTools (note the central point emphasized)
this point is not necessary for the
definition of the line that is in that
stretch rectilinear and uniquely
defined by the initial vertex and the
final one;
this is the result of my script (as you
can see, the only preserved vertices are those
essential to the definition of the line)
one more example: the original line
The line cleaned with fTools: still a
point unnecessary
This the line cleaned with my script:
the point is eliminated.
If I may hazard a guess, is the central point(*) to be critical: if this
is far from the line joining the start point - end point, as evident in
the first case, it is still preserved, although a subsequent analysis
could be eliminated.
I do not have enough mathematical skills to do an analysis of the
problem and probably I can not even speak of error, because the
final result is correct, in fact the RDP algorithm provides a line
similar to the original one, certainly simplified;
perhaps what we can say is that this solution is not optimal, since
in some cases, such as those seen above, leaves vertices
unnecessary to define the line.
(*) more precisely, the center point of each portion of the line.
One more note:
analyzing the problem it happens that the vertex 2 has
the greater distance from the base line 0-4, therefore
becomes one of the cornerstones of the line
If the distance was slightly shorter it would have
been overlooked and therefore eliminated
After this necessary clarification, I
continue with the presentation of my
script
With the advice that my script is purely experimental and
need for accommodation.
Furthermore, it has purposes different from the RDP
algorithm, because:
●

●

The intention is conservative: intends to build the same
original line, using only the vertices strictly necessary
The algorithm is different, based on a locally defined
approach
Disclaimer
This script is not intended to be an improvement of the RDP algorithm or
any other similar algorithm; it is an independent, simple and naive approach
to the problem of discarding unnecessary points from a linestring.
This is a DTM 20m ~9km x 9km of
my town, near Milan, Italy
Extracting the contour lines
(Raster → Estrazione → Curve di
livello) (sorry, I've an italian menu :-)
We have >46000 points!
Many points are redundant:
- or too near
- or, more frequently in this case,
aligned;
thus I've written an (experimental)
python script that should (it's far from
certain :-):
a) simplify eliminating the points too near
b) rectify eliminating aligned points
below threshold value decided by the
user
This is a result of my script
the original ones (red wider)
and the news simplified (yellow finer)
These are the points after
simplification procedure (<11000)
This is an enlargement where we can see that the
only retained points are the fundamental ones :-)
the original ones (green circles) and the news
(stars)
… more enlarged …...
Author's approach to the problem
Simplify code
Rectify code
Flow chart of the algorithm
Passo 1
Passo 2
Passo 3
Passo.....
Probably there are other, and even
better, similar tools, but I've made
this one and offer it to the
community if it can be useful for
someone
(remember this is an experimental tool !)

thank You :-)
Giuliano Curti, Melegnano (Mi), 2014-02-01
With apologies for my bad english :-)

Weitere ähnliche Inhalte

Was ist angesagt?

Comparison of Various Line Clipping Algorithm for Improvement
Comparison of Various Line Clipping Algorithm for ImprovementComparison of Various Line Clipping Algorithm for Improvement
Comparison of Various Line Clipping Algorithm for ImprovementIJMER
 
PYTHON REVISION TOUR - 1
PYTHON REVISION TOUR - 1PYTHON REVISION TOUR - 1
PYTHON REVISION TOUR - 1AyushGupta976
 
Type Conversion in C++ and C# Arithmetic Expressions
Type Conversion in C++ and C# Arithmetic ExpressionsType Conversion in C++ and C# Arithmetic Expressions
Type Conversion in C++ and C# Arithmetic ExpressionsPVS-Studio
 
Matlab intro notes
Matlab intro notesMatlab intro notes
Matlab intro notespawanss
 
Factor Graph & Sum-Product Algorithm
Factor Graph & Sum-Product AlgorithmFactor Graph & Sum-Product Algorithm
Factor Graph & Sum-Product AlgorithmXixiu Ouyang
 
Csharp4 operators and_casts
Csharp4 operators and_castsCsharp4 operators and_casts
Csharp4 operators and_castsAbed Bukhari
 
Matlab lecture 1 - installation of matlab, introduction and course outline@taj
Matlab lecture 1 - installation of matlab, introduction and course outline@tajMatlab lecture 1 - installation of matlab, introduction and course outline@taj
Matlab lecture 1 - installation of matlab, introduction and course outline@tajTajim Md. Niamat Ullah Akhund
 
Intermediate code generation (Compiler Design)
Intermediate code generation (Compiler Design)   Intermediate code generation (Compiler Design)
Intermediate code generation (Compiler Design) Tasif Tanzim
 
Lecture 12 intermediate code generation
Lecture 12 intermediate code generationLecture 12 intermediate code generation
Lecture 12 intermediate code generationIffat Anjum
 

Was ist angesagt? (19)

Ch8 Arrays
Ch8 ArraysCh8 Arrays
Ch8 Arrays
 
Comparison of Various Line Clipping Algorithm for Improvement
Comparison of Various Line Clipping Algorithm for ImprovementComparison of Various Line Clipping Algorithm for Improvement
Comparison of Various Line Clipping Algorithm for Improvement
 
Pcd201516
Pcd201516Pcd201516
Pcd201516
 
PYTHON REVISION TOUR - 1
PYTHON REVISION TOUR - 1PYTHON REVISION TOUR - 1
PYTHON REVISION TOUR - 1
 
Type Conversion in C++ and C# Arithmetic Expressions
Type Conversion in C++ and C# Arithmetic ExpressionsType Conversion in C++ and C# Arithmetic Expressions
Type Conversion in C++ and C# Arithmetic Expressions
 
Matlab intro notes
Matlab intro notesMatlab intro notes
Matlab intro notes
 
Factor Graph & Sum-Product Algorithm
Factor Graph & Sum-Product AlgorithmFactor Graph & Sum-Product Algorithm
Factor Graph & Sum-Product Algorithm
 
Assignment
AssignmentAssignment
Assignment
 
C programming part2
C programming part2C programming part2
C programming part2
 
Csharp4 operators and_casts
Csharp4 operators and_castsCsharp4 operators and_casts
Csharp4 operators and_casts
 
Assignment12
Assignment12Assignment12
Assignment12
 
Matlab lecture 1 - installation of matlab, introduction and course outline@taj
Matlab lecture 1 - installation of matlab, introduction and course outline@tajMatlab lecture 1 - installation of matlab, introduction and course outline@taj
Matlab lecture 1 - installation of matlab, introduction and course outline@taj
 
Basic of c &c++
Basic of c &c++Basic of c &c++
Basic of c &c++
 
Basic concept of c++
Basic concept of c++Basic concept of c++
Basic concept of c++
 
C programming session3
C programming  session3C programming  session3
C programming session3
 
Intermediate code generation (Compiler Design)
Intermediate code generation (Compiler Design)   Intermediate code generation (Compiler Design)
Intermediate code generation (Compiler Design)
 
C programming session5
C programming  session5C programming  session5
C programming session5
 
C programming session7
C programming  session7C programming  session7
C programming session7
 
Lecture 12 intermediate code generation
Lecture 12 intermediate code generationLecture 12 intermediate code generation
Lecture 12 intermediate code generation
 

Andere mochten auch

Spherical trigonometry
Spherical trigonometrySpherical trigonometry
Spherical trigonometryGiuliano Curti
 
Rai qt presentazione-2015-06-03
Rai qt presentazione-2015-06-03Rai qt presentazione-2015-06-03
Rai qt presentazione-2015-06-03Giuliano Curti
 
Topog4qgis tech documentation
Topog4qgis tech documentationTopog4qgis tech documentation
Topog4qgis tech documentationGiuliano Curti
 
Graphs plugin 20160923-ita
Graphs plugin 20160923-itaGraphs plugin 20160923-ita
Graphs plugin 20160923-itaGiuliano Curti
 
Geographic vs geocentric coordinates-2015-02-03-ita
Geographic vs geocentric coordinates-2015-02-03-itaGeographic vs geocentric coordinates-2015-02-03-ita
Geographic vs geocentric coordinates-2015-02-03-itaGiuliano Curti
 
Graphs plugin 20160923-eng
Graphs plugin 20160923-engGraphs plugin 20160923-eng
Graphs plugin 20160923-engGiuliano Curti
 
Stress associated with being a student
Stress associated with being a studentStress associated with being a student
Stress associated with being a studentRicheeka Giri
 
Presentation of the Skolkovo resident, tft
Presentation of the Skolkovo resident, tftPresentation of the Skolkovo resident, tft
Presentation of the Skolkovo resident, tftponomarevajulia
 
Presentation tft for_startup_village_05 2013_rus_ver_2
Presentation tft for_startup_village_05 2013_rus_ver_2Presentation tft for_startup_village_05 2013_rus_ver_2
Presentation tft for_startup_village_05 2013_rus_ver_2ponomarevajulia
 
Customer Satisfaction in Retail Banks- Empirical Study
Customer Satisfaction in Retail Banks- Empirical StudyCustomer Satisfaction in Retail Banks- Empirical Study
Customer Satisfaction in Retail Banks- Empirical Studyprem velpula
 
Презентация резидента Сколково, Тонопленочные технологии
Презентация резидента Сколково, Тонопленочные технологииПрезентация резидента Сколково, Тонопленочные технологии
Презентация резидента Сколково, Тонопленочные технологииponomarevajulia
 
Weather introduction
Weather introductionWeather introduction
Weather introductionchristymoxham
 
La situación de los microemprendimientos en la ciudad de Trelew
La situación de los microemprendimientos en la ciudad de TrelewLa situación de los microemprendimientos en la ciudad de Trelew
La situación de los microemprendimientos en la ciudad de TrelewLucas Orozco
 
Point4qgis presentation
Point4qgis presentationPoint4qgis presentation
Point4qgis presentationGiuliano Curti
 
yogesh_surve_resume
yogesh_surve_resumeyogesh_surve_resume
yogesh_surve_resumeyogesh surve
 
Celebrity aamir khan brand ambassador
Celebrity aamir khan brand ambassadorCelebrity aamir khan brand ambassador
Celebrity aamir khan brand ambassadorVicky Sharma
 

Andere mochten auch (20)

Topog presentation
Topog presentationTopog presentation
Topog presentation
 
Spherical trigonometry
Spherical trigonometrySpherical trigonometry
Spherical trigonometry
 
Rai qt presentazione-2015-06-03
Rai qt presentazione-2015-06-03Rai qt presentazione-2015-06-03
Rai qt presentazione-2015-06-03
 
Topog4qgis tech documentation
Topog4qgis tech documentationTopog4qgis tech documentation
Topog4qgis tech documentation
 
Graphs plugin 20160923-ita
Graphs plugin 20160923-itaGraphs plugin 20160923-ita
Graphs plugin 20160923-ita
 
Geographic vs geocentric coordinates-2015-02-03-ita
Geographic vs geocentric coordinates-2015-02-03-itaGeographic vs geocentric coordinates-2015-02-03-ita
Geographic vs geocentric coordinates-2015-02-03-ita
 
Vect georef
Vect georefVect georef
Vect georef
 
Graphs plugin 20160923-eng
Graphs plugin 20160923-engGraphs plugin 20160923-eng
Graphs plugin 20160923-eng
 
Stress associated with being a student
Stress associated with being a studentStress associated with being a student
Stress associated with being a student
 
Presentation of the Skolkovo resident, tft
Presentation of the Skolkovo resident, tftPresentation of the Skolkovo resident, tft
Presentation of the Skolkovo resident, tft
 
Zooe presentation
Zooe presentationZooe presentation
Zooe presentation
 
Presentation tft for_startup_village_05 2013_rus_ver_2
Presentation tft for_startup_village_05 2013_rus_ver_2Presentation tft for_startup_village_05 2013_rus_ver_2
Presentation tft for_startup_village_05 2013_rus_ver_2
 
Customer Satisfaction in Retail Banks- Empirical Study
Customer Satisfaction in Retail Banks- Empirical StudyCustomer Satisfaction in Retail Banks- Empirical Study
Customer Satisfaction in Retail Banks- Empirical Study
 
Презентация резидента Сколково, Тонопленочные технологии
Презентация резидента Сколково, Тонопленочные технологииПрезентация резидента Сколково, Тонопленочные технологии
Презентация резидента Сколково, Тонопленочные технологии
 
Weather introduction
Weather introductionWeather introduction
Weather introduction
 
La situación de los microemprendimientos en la ciudad de Trelew
La situación de los microemprendimientos en la ciudad de TrelewLa situación de los microemprendimientos en la ciudad de Trelew
La situación de los microemprendimientos en la ciudad de Trelew
 
Point4qgis presentation
Point4qgis presentationPoint4qgis presentation
Point4qgis presentation
 
Analisis swot 1
Analisis swot 1Analisis swot 1
Analisis swot 1
 
yogesh_surve_resume
yogesh_surve_resumeyogesh_surve_resume
yogesh_surve_resume
 
Celebrity aamir khan brand ambassador
Celebrity aamir khan brand ambassadorCelebrity aamir khan brand ambassador
Celebrity aamir khan brand ambassador
 

Ähnlich wie Simplifying & Rectifying SHP Linestring Layer

Wade not in unknown waters. Part three.
Wade not in unknown waters. Part three.Wade not in unknown waters. Part three.
Wade not in unknown waters. Part three.PVS-Studio
 
Fundamental of Information Technology - UNIT 6
Fundamental of Information Technology - UNIT 6Fundamental of Information Technology - UNIT 6
Fundamental of Information Technology - UNIT 6Shipra Swati
 
C++11 and 64-bit Issues
C++11 and 64-bit IssuesC++11 and 64-bit Issues
C++11 and 64-bit IssuesAndrey Karpov
 
(Slides) Efficient Evaluation Methods of Elementary Functions Suitable for SI...
(Slides) Efficient Evaluation Methods of Elementary Functions Suitable for SI...(Slides) Efficient Evaluation Methods of Elementary Functions Suitable for SI...
(Slides) Efficient Evaluation Methods of Elementary Functions Suitable for SI...Naoki Shibata
 
24 common mistakes in go (gotchas) and how to avoid them
24 common mistakes in go (gotchas) and how to avoid them24 common mistakes in go (gotchas) and how to avoid them
24 common mistakes in go (gotchas) and how to avoid themKaty Slemon
 
c-for-c-programmers.pdf
c-for-c-programmers.pdfc-for-c-programmers.pdf
c-for-c-programmers.pdfSalar32
 
An Experiment with Checking the glibc Library
An Experiment with Checking the glibc LibraryAn Experiment with Checking the glibc Library
An Experiment with Checking the glibc LibraryAndrey Karpov
 
Basics of Programming - A Review Guide
Basics of Programming - A Review GuideBasics of Programming - A Review Guide
Basics of Programming - A Review GuideBenjamin Kissinger
 
Miranda NG Project to Get the "Wild Pointers" Award (Part 1)
Miranda NG Project to Get the "Wild Pointers" Award (Part 1) Miranda NG Project to Get the "Wild Pointers" Award (Part 1)
Miranda NG Project to Get the "Wild Pointers" Award (Part 1) Andrey Karpov
 
Tesseract. Recognizing Errors in Recognition Software
Tesseract. Recognizing Errors in Recognition SoftwareTesseract. Recognizing Errors in Recognition Software
Tesseract. Recognizing Errors in Recognition SoftwareAndrey Karpov
 
Practical Guides on Programming with Big Number Library in Scientific Researches
Practical Guides on Programming with Big Number Library in Scientific ResearchesPractical Guides on Programming with Big Number Library in Scientific Researches
Practical Guides on Programming with Big Number Library in Scientific Researchestheijes
 
Undefined behavior is closer than you think
Undefined behavior is closer than you thinkUndefined behavior is closer than you think
Undefined behavior is closer than you thinkAndrey Karpov
 

Ähnlich wie Simplifying & Rectifying SHP Linestring Layer (20)

Wade not in unknown waters. Part three.
Wade not in unknown waters. Part three.Wade not in unknown waters. Part three.
Wade not in unknown waters. Part three.
 
Fundamental of Information Technology - UNIT 6
Fundamental of Information Technology - UNIT 6Fundamental of Information Technology - UNIT 6
Fundamental of Information Technology - UNIT 6
 
C++11 and 64-bit Issues
C++11 and 64-bit IssuesC++11 and 64-bit Issues
C++11 and 64-bit Issues
 
(Slides) Efficient Evaluation Methods of Elementary Functions Suitable for SI...
(Slides) Efficient Evaluation Methods of Elementary Functions Suitable for SI...(Slides) Efficient Evaluation Methods of Elementary Functions Suitable for SI...
(Slides) Efficient Evaluation Methods of Elementary Functions Suitable for SI...
 
24 common mistakes in go (gotchas) and how to avoid them
24 common mistakes in go (gotchas) and how to avoid them24 common mistakes in go (gotchas) and how to avoid them
24 common mistakes in go (gotchas) and how to avoid them
 
c-for-c-programmers.pdf
c-for-c-programmers.pdfc-for-c-programmers.pdf
c-for-c-programmers.pdf
 
C –FAQ:
C –FAQ:C –FAQ:
C –FAQ:
 
An Experiment with Checking the glibc Library
An Experiment with Checking the glibc LibraryAn Experiment with Checking the glibc Library
An Experiment with Checking the glibc Library
 
Eryk_Kulikowski_a4
Eryk_Kulikowski_a4Eryk_Kulikowski_a4
Eryk_Kulikowski_a4
 
Basics of Programming - A Review Guide
Basics of Programming - A Review GuideBasics of Programming - A Review Guide
Basics of Programming - A Review Guide
 
Computer Architecture Assignment Help
Computer Architecture Assignment HelpComputer Architecture Assignment Help
Computer Architecture Assignment Help
 
Travelling salesman problem
Travelling salesman problemTravelling salesman problem
Travelling salesman problem
 
Miranda NG Project to Get the "Wild Pointers" Award (Part 1)
Miranda NG Project to Get the "Wild Pointers" Award (Part 1) Miranda NG Project to Get the "Wild Pointers" Award (Part 1)
Miranda NG Project to Get the "Wild Pointers" Award (Part 1)
 
Grounded Pointers
Grounded PointersGrounded Pointers
Grounded Pointers
 
Tesseract. Recognizing Errors in Recognition Software
Tesseract. Recognizing Errors in Recognition SoftwareTesseract. Recognizing Errors in Recognition Software
Tesseract. Recognizing Errors in Recognition Software
 
Practical Guides on Programming with Big Number Library in Scientific Researches
Practical Guides on Programming with Big Number Library in Scientific ResearchesPractical Guides on Programming with Big Number Library in Scientific Researches
Practical Guides on Programming with Big Number Library in Scientific Researches
 
17 Jo P May 08
17 Jo P May 0817 Jo P May 08
17 Jo P May 08
 
Undefined behavior is closer than you think
Undefined behavior is closer than you thinkUndefined behavior is closer than you think
Undefined behavior is closer than you think
 
Notion of Algorithms.pdf
Notion of Algorithms.pdfNotion of Algorithms.pdf
Notion of Algorithms.pdf
 
99995327.ppt
99995327.ppt99995327.ppt
99995327.ppt
 

Kürzlich hochgeladen

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...RKavithamani
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 

Kürzlich hochgeladen (20)

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 

Simplifying & Rectifying SHP Linestring Layer

  • 1. Simplifying & Rectifying a SHP Linestring Layer by Giuliano Curti (giulianc51 at gmail dot com) Gennaio 2014 While I was interested in my ideas about 3D data in QGIS I met the contour lines.... v. 2014-02-01
  • 2. my initial intention was to clean the lines (obtained from DEM) from the flurry of points; when I planned this script I did not know that the job were already possible in QGIS with the help of fTools; I knew even less about the Ramer-Douglas-Peucker algorithm used by fTools. At the discovery of my error, reported to me by a friend of the Italian GFOSS mailing list, I wanted to compare my game procedure with that of fTools, finding that my script behaved well all things considered: in one test case my script was cleaning the lines from the original 46k vertices at only 10711, compared to 10716 of QGIS / fTools.
  • 3. 5 out of 11k are almost a trivial problem, even though I was intrigued so I wanted to investigate; with the help of Spatialite I have identified 5 points that appeared in fTools and not in my result; some points were caused by different threshold used, but other do not and I discovered something interesting: a small flaw in the RDP algorithm ! look at the next slide:
  • 4. This is an original line (look at how many red crosses indicating the number of vertices
  • 5. this is the same line cleaned with fTools (note the central point emphasized)
  • 6. this point is not necessary for the definition of the line that is in that stretch rectilinear and uniquely defined by the initial vertex and the final one;
  • 7. this is the result of my script (as you can see, the only preserved vertices are those essential to the definition of the line)
  • 8. one more example: the original line
  • 9. The line cleaned with fTools: still a point unnecessary
  • 10. This the line cleaned with my script: the point is eliminated.
  • 11. If I may hazard a guess, is the central point(*) to be critical: if this is far from the line joining the start point - end point, as evident in the first case, it is still preserved, although a subsequent analysis could be eliminated. I do not have enough mathematical skills to do an analysis of the problem and probably I can not even speak of error, because the final result is correct, in fact the RDP algorithm provides a line similar to the original one, certainly simplified; perhaps what we can say is that this solution is not optimal, since in some cases, such as those seen above, leaves vertices unnecessary to define the line. (*) more precisely, the center point of each portion of the line.
  • 12. One more note: analyzing the problem it happens that the vertex 2 has the greater distance from the base line 0-4, therefore becomes one of the cornerstones of the line
  • 13. If the distance was slightly shorter it would have been overlooked and therefore eliminated
  • 14. After this necessary clarification, I continue with the presentation of my script
  • 15. With the advice that my script is purely experimental and need for accommodation. Furthermore, it has purposes different from the RDP algorithm, because: ● ● The intention is conservative: intends to build the same original line, using only the vertices strictly necessary The algorithm is different, based on a locally defined approach Disclaimer This script is not intended to be an improvement of the RDP algorithm or any other similar algorithm; it is an independent, simple and naive approach to the problem of discarding unnecessary points from a linestring.
  • 16. This is a DTM 20m ~9km x 9km of my town, near Milan, Italy
  • 17. Extracting the contour lines (Raster → Estrazione → Curve di livello) (sorry, I've an italian menu :-)
  • 18. We have >46000 points!
  • 19. Many points are redundant: - or too near - or, more frequently in this case, aligned; thus I've written an (experimental) python script that should (it's far from certain :-): a) simplify eliminating the points too near b) rectify eliminating aligned points below threshold value decided by the user
  • 20. This is a result of my script the original ones (red wider) and the news simplified (yellow finer)
  • 21. These are the points after simplification procedure (<11000)
  • 22. This is an enlargement where we can see that the only retained points are the fundamental ones :-) the original ones (green circles) and the news (stars)
  • 24. Author's approach to the problem
  • 27. Flow chart of the algorithm
  • 32. Probably there are other, and even better, similar tools, but I've made this one and offer it to the community if it can be useful for someone (remember this is an experimental tool !) thank You :-) Giuliano Curti, Melegnano (Mi), 2014-02-01 With apologies for my bad english :-)