moovida / dart_shp

Dart shapefile reader/writer
BSD 3-Clause "New" or "Revised" License
8 stars 8 forks source link

Added basic example script that can help as a starting point for people #7

Closed sheldoncoup closed 7 months ago

sheldoncoup commented 7 months ago

Simple example script for saving some random points and polygons. Not totally sure the the provided examples are the recommended way of saving things but they seem to work for my purposes. Also added a verbose flag to the polygon writer write method just to cut down on some of the prints.

moovida commented 7 months ago

Hi @sheldoncoup , thanks for contributing.

I am not sure we should add an example part, since there is the tests part that "should" cover every usecase. Just to be sure, didn't you notice it or didn't it fit your needs? There is a writing section: https://github.com/moovida/dart_shp/blob/master/test/dart_shp_test.dart#L485-L628

Totally agree about the verbose part, didn't remember.

sheldoncoup commented 7 months ago

No worries, thanks for putting all this together in the first place!

Yeah that's a fair point, I did use the test cases as the basis for the above example code. My thoughts around having the example code where more so that something basic would be visible on the pub.dev page as I know its always my first port of call when using new libraries. Though in fairness for completeness it would make sense to also have a reading example to cover the major use cases. Could always just write a comment referring people to the test cases for examples? Totally up to you

moovida commented 7 months ago

Hi @sheldoncoup , I had not thought of the example page on pub. And I agree with you that it is great to have soemthing shown there. So I will merge this in. Thanks