Closed spwoodcock closed 4 months ago
Hello, I am an Outreachy applicant, Could you please provide additional details on how I can begin working on this project, particularly setting it up locally on my machine? @spwoodcock
@ohthebrave I updated the description to include a lot more instructions, including how to set up the repo and run the code.
Hope this helps!
Good idea to use BytesIO for this, I prefer to use memory as much as possible instead of disk files. Course we still need the disk file, but it can be produced from what's in memory. Before FMTM, basemapper was only used standalone in a terminal, so the file was fine. But using memory is better when part of a backend API.
Thanks for the instructions on setting up the repo and running the code @spwoodcock
Thank you for providing guidance on configuring the repository and executing the code. @spwoodcock
Hello mentor, @spwoodcock
I trust this message finds you well. I'm currently contributing to the osm-fieldwork project. Unfortunately, I've encountered an issue with joining the Slack community associated with this project.
As mentioned in the guidelines, I have made a contribution to my fork repository, and you can find the link to my pull request here: https://github.com/donaldte/osm-fieldwork/pull/1
Thank you for your attention to this matter.
Best regards, Donald Tedom
For someone who may encounter Install psycopg2 2.9.9 failed
during pdm install -G test
, this brew install postgresql
command helped me out
Hello @spwoodcock , I have sent the link to my PR for this task, looking forward to your feedback. Thank you
For someone who may encounter
Install psycopg2 2.9.9 failed
duringpdm install -G test
, thisbrew install postgresql
command helped me out
The underlying package this installs to fix the issue is libpq
, available on MacOS via brew, and most Linux distributions as libpq-dev
Hello @spwoodcock,
I was getting confused with the output file while running the code. I encountered this after I ran the code:
MainThread - main - INFO - Downloading 1 tiles in thread 15308 to C:\Users\Sahana K\Desktop\Outreachy\osm-fieldwork\esritiles Getting file from: http://services.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer/tile/15/12206/15953.jpg [*] 26 kB / 26 kB @ 0 bytes/s [##################] [100%, 0s left] MainThread - main - INFO - No outfile specified, tile download finished: C:\Users\Sahana K\Desktop\Outreachy\osm-fieldwork\esritiles
The command that I used to run the basemapper.py was: pdm run python osm_fieldwork/basemapper.py -b -4.730494 41.650541 -4.725634 41.652874 -z 12-15 -s esri
I would really appreciate if you would take some time and help me with this as I am new to open source.
Thank you so much for your time on this matter.
If you can see the tile images in the esritiles directory, then the script was successful.
You can bundle the images to an mbtiles file, but it's not mandatory. Use the -o
flag if you want to do that.
I would like to contribute to this project
@spwoodcock, I'm an Outreachy intern interested in contributing to this project. After reviewing the repository, I noticed there aren't any good first issues available. Could you please guide me on where to start my contribution?
@spwoodcock, I'm an Outreachy intern interested in contributing to this project. After reviewing the repository, I noticed there aren't any good first issues available. Could you please guide me on where to start my contribution?
Hello, if you're an outreachy applicant, you could work on the task above, as it is a general issue open to all applicants. All applicants are advised to work on this task and all instructions regarding this task have been provided by the mentor, @spwoodcock in the issue's description;
Hello @spwoodcock, I'm an Outreachy applicant interested in contributing to this project. I have done most of the required work, but haven't created a pull request yet. I've been trying to join the slack channel using my gmail, but I keep getting an error message that my email doesn't match the domain. How do I fix this? Or is it ok to submit the task without joining the slack channel?
***Update: I got a new link that worked. Thank you @petya-kangalova
Hey @spwoodcock, I'm an outreachy applicant and I wanted to thank you for your detailed description of the task. It has been incredibly helpful in navigating the project. On a side note, like few others I've also been encountering difficulties joining the Slack community using my Gmail account. I was wondering if you have any suggestions or if there's a workaround for this issue. Thank you. Jahnavi
@endurijahnavi thank you for the nice feedback. Apologies for the issues with joining Slack- I have now sent an invite request to your email. If any issues, please drop me an email to petya.kangalova@hotosm.org
I will revert with a PR link shortly
@spwoodcock I sent my PR link to your slack inbox as instructed, almost 2 weeks ago, and I haven't gotten a feedback. Here it is again, just in case https://github.com/medinasheriff/osm-fieldwork/pull/1
Please look into this @spwoodcock https://github.com/sahana-9314/osm-fieldwork/pull/2
Sorry for that problem before. Can you please check the updated one. https://github.com/sahana-9314/osm-fieldwork/pull/1
Outreachy Task
MBTile Basemaps
The Current Implementation
bbox
.x_min, y_min, x_max, y_max
:The Issue
bytes
object).bytes
wrapped in aBytesIO
wrapper).The Solution
main()
function that is only used when running basemapper via the command line. The file should be read and converted to BytesIO object, before passing through to thecreate_basemap_file
function.Instructions
Set up your repo
Fork the osm-fieldwork repository: https://github.com/hotosm/osm-fieldwork/fork
Clone the forked repository to your filesystem and create a new branch:
Solve the problem by writing and committing new code.
Create a pull request from your new branch to the
main
branch within your forked repo (please do not create a pull request against the hotosm/osm-fieldwork repo).Prerequisites
Install PDM:
Install the dependencies for osm-fieldwork:
Testing your code
To save time and overloading networks, I would recommend building a minimal basemap during testing by using the command specified below.
There is a command line interface to basemapper that works like:
As you can see the boundary is passed in using flag
-b
and can be a bounding box or GeoJSON file.The goal of this task is to allow for passing the GeoJSON file in-memory when using basemapper via a script.
Using via Python script
Create a file
outreachy.py
in the repo of your code repository:Run the file to generate a
.mbtiles
archive:Using via PyTest
This method is slightly more complex, requiring Docker to be installed. You may skip this step if necessary.
Open the existing
tests/test_basemap.py
file to see the current test.Run the test from the code repository root:
Writing your solution
You will need to modify
create_basemap_file
inbasemapper.py
so that theboundary
parameter accepts a BytesIO object, in addition to a bounding box or geojson file.In the end, we want to be able to use the function like this:
Important notes on submission
Your code should not be submitted through email, slack, a PR to this repository, or any other means.
main
branch on your fork.outreachy
channel on Slack, so that everyone can benefit.FAQ
Issues installing psycopg2
psycopg2 requires
libpq-dev
to be installed on your system. In short there are solutions for each OS below:Ubuntu/Debian
MacOS
Windows
(requires a workaround, try either)
or