First Manual API Run¶
This page turns one concrete question into one traceable CoRE Stack run:
How much of my tehsil or block is built-up?
Use it as the bridge between "the backend is running" and "I can follow one real computation through the stack."
What You Will Do¶
- choose a place
- trigger one LULC run
- trace the route and handler
- inspect the next computation file
- calculate the built-up share from the output
Before You Start¶
- Complete Installer first.
- Keep one valid
gee_account_idready if your local setup requires it. - Start with the normal tehsil or block route if you already know the place names.
If exact spellings are difficult, use the fallback at the end of this page to start from latitude and longitude instead.
Step 1: Pick A Place¶
The typical path uses:
statedistrictblockortehsil
Example:
state:karnatakadistrict:raichurblock:devadurga
If you are not sure about the spellings, first use GeoAdmin (NoAuth) APIs to confirm the exact location names you should send into the computation route.
Reveal a quick location-finding route
Start with your state: Once you find your state (eg: 29), start with: Using the district code in your state, follow with: That lets you copy the exact district and block names before you try the computation route locally.Step 2: Trigger one LULC Run¶
Start with the tehsil-level LULC route because it keeps the scope easy to inspect.
curl -X POST \
-H "Content-Type: application/json" \
-d '{
"state": "karnataka",
"district": "raichur",
"block": "devadurga",
"start_year": 2022,
"end_year": 2023,
"gee_account_id": 1
}' \
http://127.0.0.1:8000/api/v1/lulc_for_tehsil/
Why this route?
- it is a real computation endpoint already listed in Computing API Endpoints
- built-up is one class inside the resulting LULC output
- it gives you a clean path from request to handler to computation module
Reveal what success should look like
The route should acknowledge the request quickly, because the heavy work usually moves into a task or computation boundary after the handler parses the payload. If nothing happens, stop here and check: - the backend server is running - your request keys are spelled exactly as expected - your local environment has the required Earth Engine configurationStep 3: Find The Route In Code¶
Open the route file first:
Look for a line shaped like this:
You are not trying to memorize the whole file. You are only verifying one thing:
the incoming POST /api/v1/lulc_for_tehsil/ request really has a named route in the computing surface.
Reveal the next clue
Once you find the route entry, the next useful question is: which handler in `computing/api.py` owns this request?Step 4: Inspect The Handler¶
Now open:
The handler will usually have this overall shape:
Focus on the highlighted parts:
- request fields are normalized early
- the handler stays thin
- the real work is handed off to a task or computation boundary
Reveal what to inspect next
Do not stop at the handler. Search for the task or function it calls, then follow that into the LULC workflow module under `computing/`. That is the point where the route stops being an API concern and becomes a geospatial computation concern.Step 5: Follow The Computation Path¶
At this point, your next useful references are:
- How They Work Programmatically
- LULC Generation
- the LULC-related module under
computing/in the backend repo
Use this rule while tracing:
computing/urls.pytells you the route namecomputing/api.pytells you the handler and task handoff- the LULC module tells you how the result is actually produced
If you lose the trail, search for:
That usually gets you back onto the main road quickly.
Step 6: Calculate The Built-up Share¶
Once the computation finishes, extract or summarize the class areas and compute the built-up percentage.
| Turn class areas into a built-up share | |
|---|---|
What matters here is the shape of the final reasoning:
- identify the built-up class
- identify the total area under consideration
- divide built-up area by total area
- report the answer as a percentage
If your output is a table instead of a dictionary, the same rule still applies.
Optional Fallback: Start From Latitude And Longitude¶
Use this only when place names are hard to resolve or you want a quick local dry run around a point before running the full tehsil workflow.
This is a local exploration shortcut, not the canonical published tehsil route.
Use this fallback to answer a smaller question first:
"Around this point, in a 1 km radius, what share is built-up?"
Then return to the tehsil route once you are ready to run the full administrative unit.
Outcome¶
By the end of this page, you should have:
- sent one real LULC request
- located the route and handler in code
- followed the handoff into the computation layer
- calculated one built-up-share result for a place or a 1 km local ROI
If you want the next step after this, continue into Local Pipeline First or How They Work Programmatically.