Skip to content

Commit

Permalink
Update READMEs
Browse files Browse the repository at this point in the history
  • Loading branch information
Diviloper committed Nov 19, 2022
1 parent 54c9692 commit d36fc80
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,22 @@ pip install pymeos
## Sample code

> **IMPORTANT** Before using any PyMEOS function, always call `meos_initialize`. Otherwise, the library will
> crash with a `Segmentation Fault` error. You should also always call `meos_finish` at the end of your code.
> **IMPORTANT** Before using any PyMEOS function, always call `pymeos_initialize`. Otherwise, the library will
> crash with a `Segmentation Fault` error. You should also always call `pymeos_finalize` at the end of your code.
````python
from pymeos import meos_initialize, meos_finish, TGeogPointInst, TGeogPointSeq
from pymeos import pymeos_initialize, pymeos_finalize, TGeogPointInst, TGeogPointSeq

# Important: Always initialize MEOS library
meos_initialize()
pymeos_initialize()

sequence_from_string = TGeogPointSeq(string='[Point(10.0 10.0)@2019-09-01 00:00:00+01, Point(20.0 20.0)@2019-09-02 00:00:00+01, Point(10.0 10.0)@2019-09-03 00:00:00+01]')
print(f'Output: {sequence_from_string}')

sequence_from_points = TGeogPointSeq(instant_list=[TGeogPointInst(string='Point(10.0 10.0)@2019-09-01 00:00:00+01'), TGeogPointInst(string='Point(20.0 20.0)@2019-09-02 00:00:00+01'), TGeogPointInst(string='Point(10.0 10.0)@2019-09-03 00:00:00+01')], lower_inc=True, upper_inc=True)
speed = sequence_from_points.speed
speed = sequence_from_points.speed()
print(f'Speeds: {speed}')

# Call finish at the end of your code
meos_finish()
pymeos_finalize()
````
2 changes: 1 addition & 1 deletion pymeos/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ sequence_from_string = TGeogPointSeq(string='[Point(10.0 10.0)@2019-09-01 00:00:
print(f'Output: {sequence_from_string}')

sequence_from_points = TGeogPointSeq(instant_list=[TGeogPointInst(string='Point(10.0 10.0)@2019-09-01 00:00:00+01'), TGeogPointInst(string='Point(20.0 20.0)@2019-09-02 00:00:00+01'), TGeogPointInst(string='Point(10.0 10.0)@2019-09-03 00:00:00+01')], lower_inc=True, upper_inc=True)
speed = sequence_from_points.speed
speed = sequence_from_points.speed()
print(f'Speeds: {speed}')

# Call finish at the end of your code
Expand Down

0 comments on commit d36fc80

Please sign in to comment.