Geodesic Line Simplification

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Geodesic Line Simplification

C Hamilton
Are there any geodesic QGIS algorithms that simplify lines? "Simplify" just uses the projection units of measure. If there isn't I thought I would add this to the Shape Tools plugin. I could easily implement the Douglas-Peucker algorithm using geodesic math.

For GPS tracks I also see a need to throw out all points that are less than a certain distance or less than a certain time interval. I don't see any simplification algorithms that make use of time. Am I just missing them?

Thanks,

Calvin

_______________________________________________
Qgis-user mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
Reply | Threaded
Open this post in threaded view
|

Re: [QGIS-Developer] Geodesic Line Simplification

Tim Sutton-6
Hi

On 26 Sep 2019, at 17:13, C Hamilton <[hidden email]> wrote:

Are there any geodesic QGIS algorithms that simplify lines? "Simplify" just uses the projection units of measure. If there isn't I thought I would add this to the Shape Tools plugin. I could easily implement the Douglas-Peucker algorithm using geodesic math.

For GPS tracks I also see a need to throw out all points that are less than a certain distance or less than a certain time interval. I don't see any simplification algorithms that make use of time. Am I just missing them?

No I don’t think we have any time based simplifiers - would be a great addition!

Regards

Tim




Thanks,

Calvin
_______________________________________________
QGIS-Developer mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer









Tim Sutton

Co-founder: Kartoza
Ex Project chair: QGIS.org

Visit http://kartoza.com to find out about open source:

Desktop GIS programming services
Geospatial web development
GIS Training
Consulting Services

Skype: timlinux 
IRC: timlinux on #qgis at freenode.net

I'd love to connect. Here's my calendar link to make finding time easy.


_______________________________________________
Qgis-user mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
Reply | Threaded
Open this post in threaded view
|

Re: [QGIS-Developer] Geodesic Line Simplification

arongergely
Hi Calvin and list,

Have you looked at the GRASS GIS v.generalize tool? https://grass.osgeo.org/grass64/manuals/v.generalize.html

The Douglas-Peucker algorithm is implemented there and I have used that with (topologic)success recently on many touching polygons. Should work for polylines too!

Best regards,
Aron

On 01/10/2019 08:19, Tim Sutton wrote:
Hi

On 26 Sep 2019, at 17:13, C Hamilton <[hidden email]> wrote:

Are there any geodesic QGIS algorithms that simplify lines? "Simplify" just uses the projection units of measure. If there isn't I thought I would add this to the Shape Tools plugin. I could easily implement the Douglas-Peucker algorithm using geodesic math.

For GPS tracks I also see a need to throw out all points that are less than a certain distance or less than a certain time interval. I don't see any simplification algorithms that make use of time. Am I just missing them?

No I don’t think we have any time based simplifiers - would be a great addition!

Regards

Tim




Thanks,

Calvin
_______________________________________________
QGIS-Developer mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer









Tim Sutton

Co-founder: Kartoza
Ex Project chair: QGIS.org

Visit http://kartoza.com to find out about open source:

Desktop GIS programming services
Geospatial web development
GIS Training
Consulting Services

Skype: timlinux 
IRC: timlinux on #qgis at freenode.net

I'd love to connect. Here's my calendar link to make finding time easy.


_______________________________________________
QGIS-Developer mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

_______________________________________________
Qgis-user mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
Reply | Threaded
Open this post in threaded view
|

Re: [QGIS-Developer] Geodesic Line Simplification

C Hamilton
Nyall,

I have this partially implemented and will get back with you in a few days.

On Wed, Oct 2, 2019 at 7:51 PM Nyall Dawson <[hidden email]> wrote:
On Wed, 2 Oct 2019 at 01:30, C Hamilton <[hidden email]> wrote:
>
> I am guessing this is working on Cartesian coordinates and not geodesic which is fine if you have a local projection. I think I will go ahead and implement some similar geodesic algorithms. Thank you for the GRASS link. It will help.

Hi Calvin,

I think there's a strong use case for adding this to the c++ API.
Would you be willing to put together a proof of concept in Python code
and I'll port it to c++ for you?

Nyall


>
> Thanks,
>
> Calvin
>
> On Tue, Oct 1, 2019 at 7:45 AM Áron Gergely <[hidden email]> wrote:
>>
>> Hi Calvin and list,
>>
>> Have you looked at the GRASS GIS v.generalize tool? https://grass.osgeo.org/grass64/manuals/v.generalize.html
>>
>> The Douglas-Peucker algorithm is implemented there and I have used that with (topologic)success recently on many touching polygons. Should work for polylines too!
>>
>> Best regards,
>> Aron
>>
>> On 01/10/2019 08:19, Tim Sutton wrote:
>>
>> Hi
>>
>> On 26 Sep 2019, at 17:13, C Hamilton <[hidden email]> wrote:
>>
>> Are there any geodesic QGIS algorithms that simplify lines? "Simplify" just uses the projection units of measure. If there isn't I thought I would add this to the Shape Tools plugin. I could easily implement the Douglas-Peucker algorithm using geodesic math.
>>
>> For GPS tracks I also see a need to throw out all points that are less than a certain distance or less than a certain time interval. I don't see any simplification algorithms that make use of time. Am I just missing them?
>>
>>
>> No I don’t think we have any time based simplifiers - would be a great addition!
>>
>> Regards
>>
>> Tim
>>
>>
>>
>>
>> Thanks,
>>
>> Calvin
>> _______________________________________________
>> QGIS-Developer mailing list
>> [hidden email]
>> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>>
>>
>> —
>>
>>
>>
>>
>>
>>
>>
>>
>> Tim Sutton
>>
>> Co-founder: Kartoza
>> Ex Project chair: QGIS.org
>>
>> Visit http://kartoza.com to find out about open source:
>>
>> Desktop GIS programming services
>> Geospatial web development
>> GIS Training
>> Consulting Services
>>
>> Skype: timlinux
>> IRC: timlinux on #qgis at freenode.net
>>
>> I'd love to connect. Here's my calendar link to make finding time easy.
>>
>>
>> _______________________________________________
>> QGIS-Developer mailing list
>> [hidden email]
>> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>
> _______________________________________________
> QGIS-Developer mailing list
> [hidden email]
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

_______________________________________________
Qgis-user mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
Reply | Threaded
Open this post in threaded view
|

Re: [QGIS-Developer] Geodesic Line Simplification

pcav
In reply to this post by arongergely
Hi Calvin,
IMHO having simple algs with few options is less confusing for users,
and small bricks are easier to reuse. So I'm +1 with the split.
Cheers.

On 08/10/19 17:41, C Hamilton wrote:

> I have currently implemented a geodesic decimation processing routine,
> but I have a question for the community. I am thinking about making 3
> algorithms to simplify the process rather than one algorithm with more
> options where some options would not be applicable to points and other
> not applicable to lines so would you agree with my reasoning or not? If
> I break it into 3, these would be the algorithms.
>
> 1. Geodesic distance and time decimation for point layer.
> This would calculate the distance between consecutive points and if they
> don't meet the minimum distance then a point would be removed.
> Additionally, if a time field is selected it would also calculate the
> difference in time between two points and if it is less then the minimum
> time then the point would be removed. When both distance and time are
> selected and either condition is below the minimum, then the point would
> be removed. This algorithm would include an order field and group by
> field. There would be the option of preserving the last point despite
> the fact it might not meet the criteria.
>
> 2. Geodesic distance decimation for lines and perhaps polygons.
> Time would not be a part of the algorithm because the individual
> vertices don't have time associated with them. This would calculate the
> distance between consecutive vertices and if they don't meet the minimum
> geodesic distance then the vertex would be removed. There would be an
> option of preserving the final vertex despite it might not meet the
> criteria.
>
> 3. Geodesic Simply Algorithm for lines and polygons.
> This would implement geodesic versions of algorithms such the
> Douglas-Peucker algorithm for lines and polygons. Instead of using
> Cartesian math it would use geodesic math.
>
> I have #2 implemented and #1 without time. I think it is probably better
> to have a separate algorithm for points and another for lines and
> polygons. Would you agree?
>
> Thanks,
>
> Calvin
>
> On Wed, Oct 2, 2019 at 7:51 PM Nyall Dawson <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     On Wed, 2 Oct 2019 at 01:30, C Hamilton <[hidden email]
>     <mailto:[hidden email]>> wrote:
>     >
>     > I am guessing this is working on Cartesian coordinates and not
>     geodesic which is fine if you have a local projection. I think I
>     will go ahead and implement some similar geodesic algorithms. Thank
>     you for the GRASS link. It will help.
>
>     Hi Calvin,
>
>     I think there's a strong use case for adding this to the c++ API.
>     Would you be willing to put together a proof of concept in Python code
>     and I'll port it to c++ for you?
>
>     Nyall
>
>
>     >
>     > Thanks,
>     >
>     > Calvin
>     >
>     > On Tue, Oct 1, 2019 at 7:45 AM Áron Gergely
>     <[hidden email] <mailto:[hidden email]>> wrote:
>     >>
>     >> Hi Calvin and list,
>     >>
>     >> Have you looked at the GRASS GIS v.generalize tool?
>     https://grass.osgeo.org/grass64/manuals/v.generalize.html
>     >>
>     >> The Douglas-Peucker algorithm is implemented there and I have
>     used that with (topologic)success recently on many touching
>     polygons. Should work for polylines too!
>     >>
>     >> Best regards,
>     >> Aron
>     >>
>     >> On 01/10/2019 08:19, Tim Sutton wrote:
>     >>
>     >> Hi
>     >>
>     >> On 26 Sep 2019, at 17:13, C Hamilton <[hidden email]
>     <mailto:[hidden email]>> wrote:
>     >>
>     >> Are there any geodesic QGIS algorithms that simplify lines?
>     "Simplify" just uses the projection units of measure. If there isn't
>     I thought I would add this to the Shape Tools plugin. I could easily
>     implement the Douglas-Peucker algorithm using geodesic math.
>     >>
>     >> For GPS tracks I also see a need to throw out all points that are
>     less than a certain distance or less than a certain time interval. I
>     don't see any simplification algorithms that make use of time. Am I
>     just missing them?
>     >>
>     >>
>     >> No I don’t think we have any time based simplifiers - would be a
>     great addition!
>     >>
>     >> Regards
>     >>
>     >> Tim
>     >>
>     >>
>     >>
>     >>
>     >> Thanks,
>     >>
>     >> Calvin
>     >> _______________________________________________
>     >> QGIS-Developer mailing list
>     >> [hidden email]
>     <mailto:[hidden email]>
>     >> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>     >> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>     >>
>     >>
>     >> —
>     >>
>     >>
>     >>
>     >>
>     >>
>     >>
>     >>
>     >>
>     >> Tim Sutton
>     >>
>     >> Co-founder: Kartoza
>     >> Ex Project chair: QGIS.org
>     >>
>     >> Visit http://kartoza.com to find out about open source:
>     >>
>     >> Desktop GIS programming services
>     >> Geospatial web development
>     >> GIS Training
>     >> Consulting Services
>     >>
>     >> Skype: timlinux
>     >> IRC: timlinux on #qgis at freenode.net <http://freenode.net>
>     >>
>     >> I'd love to connect. Here's my calendar link to make finding time
>     easy.
>     >>
>     >>
>     >> _______________________________________________
>     >> QGIS-Developer mailing list
>     >> [hidden email]
>     <mailto:[hidden email]>
>     >> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>     >> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>     >
>     > _______________________________________________
>     > QGIS-Developer mailing list
>     > [hidden email] <mailto:[hidden email]>
>     > List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>     > Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>
>
> _______________________________________________
> Qgis-user mailing list
> [hidden email]
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>

--
Paolo Cavallini - www.faunalia.eu
QGIS.ORG Chair:
http://planet.qgis.org/planet/user/28/tag/qgis%20board/
_______________________________________________
Qgis-user mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
Reply | Threaded
Open this post in threaded view
|

Re: [QGIS-Developer] Geodesic Line Simplification

Christoph Jung
In reply to this post by arongergely
Hi Calvin,

Splitting the algorithms would be an improvement for using them in combination with other algorithms and/or plugins. 

One question:
Does the calculations in geodesic math need more time than with eukledean math? The last months I had some questions about my plugin Offline-MapMatching and all had trajectories with a small bounding box, i.e. eukledean math would be enough for good results. The distance between following trajectory points are not so big. Why do you want to implement the geodesic math (oh, it is a second question ^^)?

Sincerely,
Christoph 

Am 08.10.2019 um 17:41 schrieb C Hamilton <[hidden email]>:

I have currently implemented a geodesic decimation processing routine, but I have a question for the community. I am thinking about making 3 algorithms to simplify the process rather than one algorithm with more options where some options would not be applicable to points and other not applicable to lines so would you agree with my reasoning or not? If I break it into 3, these would be the algorithms.

1. Geodesic distance and time decimation for point layer.
This would calculate the distance between consecutive points and if they don't meet the minimum distance then a point would be removed. Additionally, if a time field is selected it would also calculate the difference in time between two points and if it is less then the minimum time then the point would be removed. When both distance and time are selected and either condition is below the minimum, then the point would be removed. This algorithm would include an order field and group by field. There would be the option of preserving the last point despite the fact it might not meet the criteria.

2. Geodesic distance decimation for lines and perhaps polygons.
Time would not be a part of the algorithm because the individual vertices don't have time associated with them. This would calculate the distance between consecutive vertices and if they don't meet the minimum geodesic distance then the vertex would be removed. There would be an option of preserving the final vertex despite it might not meet the criteria.

3. Geodesic Simply Algorithm for lines and polygons.
This would implement geodesic versions of algorithms such the Douglas-Peucker algorithm for lines and polygons. Instead of using Cartesian math it would use geodesic math.

I have #2 implemented and #1 without time. I think it is probably better to have a separate algorithm for points and another for lines and polygons. Would you agree?

Thanks,

Calvin

On Wed, Oct 2, 2019 at 7:51 PM Nyall Dawson <[hidden email]> wrote:
On Wed, 2 Oct 2019 at 01:30, C Hamilton <[hidden email]> wrote:
>
> I am guessing this is working on Cartesian coordinates and not geodesic which is fine if you have a local projection. I think I will go ahead and implement some similar geodesic algorithms. Thank you for the GRASS link. It will help.

Hi Calvin,

I think there's a strong use case for adding this to the c++ API.
Would you be willing to put together a proof of concept in Python code
and I'll port it to c++ for you?

Nyall


>
> Thanks,
>
> Calvin
>
> On Tue, Oct 1, 2019 at 7:45 AM Áron Gergely <[hidden email]> wrote:
>>
>> Hi Calvin and list,
>>
>> Have you looked at the GRASS GIS v.generalize tool? https://grass.osgeo.org/grass64/manuals/v.generalize.html
>>
>> The Douglas-Peucker algorithm is implemented there and I have used that with (topologic)success recently on many touching polygons. Should work for polylines too!
>>
>> Best regards,
>> Aron
>>
>> On 01/10/2019 08:19, Tim Sutton wrote:
>>
>> Hi
>>
>> On 26 Sep 2019, at 17:13, C Hamilton <[hidden email]> wrote:
>>
>> Are there any geodesic QGIS algorithms that simplify lines? "Simplify" just uses the projection units of measure. If there isn't I thought I would add this to the Shape Tools plugin. I could easily implement the Douglas-Peucker algorithm using geodesic math.
>>
>> For GPS tracks I also see a need to throw out all points that are less than a certain distance or less than a certain time interval. I don't see any simplification algorithms that make use of time. Am I just missing them?
>>
>>
>> No I don’t think we have any time based simplifiers - would be a great addition!
>>
>> Regards
>>
>> Tim
>>
>>
>>
>>
>> Thanks,
>>
>> Calvin
>> _______________________________________________
>> QGIS-Developer mailing list
>> [hidden email]
>> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>>
>>
>> —
>>
>>
>>
>>
>>
>>
>>
>>
>> Tim Sutton
>>
>> Co-founder: Kartoza
>> Ex Project chair: QGIS.org
>>
>> Visit http://kartoza.com to find out about open source:
>>
>> Desktop GIS programming services
>> Geospatial web development
>> GIS Training
>> Consulting Services
>>
>> Skype: timlinux
>> IRC: timlinux on #qgis at freenode.net
>>
>> I'd love to connect. Here's my calendar link to make finding time easy.
>>
>>
>> _______________________________________________
>> QGIS-Developer mailing list
>> [hidden email]
>> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>
> _______________________________________________
> QGIS-Developer mailing list
> [hidden email]
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
_______________________________________________
Qgis-user mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

_______________________________________________
Qgis-user mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
Reply | Threaded
Open this post in threaded view
|

Re: [QGIS-Developer] Geodesic Line Simplification

Christoph Jung
Thank you very much for your answer. I totally forgot projections with degrees, sorry ^^ than geodesic math will be the more general approach. 

Sincerely,
Christoph 

Am 09.10.2019 um 16:33 schrieb C Hamilton <[hidden email]>:

Good question. Geodesic math will take more time to compute. If you are using a local projection and the area of interest is small then it will be faster using euclidean math, but if your projection is using degrees (WGS84) or you are covering a large area then geodesic is a better choice.

Best wishes,

Calvin

On Wed, Oct 9, 2019 at 6:46 AM Christoph Jung <[hidden email]> wrote:
Hi Calvin,

Splitting the algorithms would be an improvement for using them in combination with other algorithms and/or plugins. 

One question:
Does the calculations in geodesic math need more time than with eukledean math? The last months I had some questions about my plugin Offline-MapMatching and all had trajectories with a small bounding box, i.e. eukledean math would be enough for good results. The distance between following trajectory points are not so big. Why do you want to implement the geodesic math (oh, it is a second question ^^)?

Sincerely,
Christoph 


_______________________________________________
Qgis-user mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user