LTHIA Precalculated Runoff - Developer Guide

This is an instructional page about how to use the simple python LTHIA REST requests.

Legacy Output Format

Path:

/cgi-bin/lthia_sum_huc12s.py

Query Parameters:

Name Possible values Description
huclist An comma-separated list of HUC12 codes, such as "050800012004,050800012003,050800012002" The list of HUC12 codes over which to run LTHIA and sum results
hucX, where X is a number starting at 1 counting up sequentially A single HUC12 code, such as "050800012004" One item in the list of HUC12 codes over which to run LTHIA and sum results

Notes:

Either the "huclist" argument, or many "hucX" arguments, such as "?huc1=050800012004&huc2=050800012003&huc3=050800012002", are required.

Legacy notes:

Analogous to the old scripts /cgi-bin/tippthuc.py and /cgi-bin/msu4.py

Examples:

/cgi-bin/lthia_sum_huc12s.py?huclist=050800012004
/cgi-bin/lthia_sum_huc12s.py?huclist=050800012004,050800012003
/cgi-bin/lthia_sum_huc12s.py?huclist=050800012003
/cgi-bin/lthia_sum_huc12s.py?huc1=050800012004
/cgi-bin/lthia_sum_huc12s.py?huc1=050800012004&huc2=050800012003
/cgi-bin/lthia_sum_huc12s.py?huc1=050800012003
                    

Path:

/cgi-bin/lthia_sum_counties.py

Query Parameters:

Name Possible values Description
fipslist An comma-separated list of 5-digit FIPS codes, such as "39023,39109,39021,39149" The list of 5-digit FIPS codes over which to run LTHIA and sum results
fipsX, where X is a number starting at 1 counting up sequentially A single 5-digit FIPS code, such as "39023" One item in the list of 5-digit FIPS codes over which to run LTHIA and sum results

Notes:

Either the "fipslist" argument, or many "fipsX" arguments, such as "?fips1=39023&fips2=39109&fips3=39021", are required.

Legacy notes:

This is a new script, no previous script was performing the same function.

Examples:

/cgi-bin/lthia_sum_counties.py?fipslist=39023
/cgi-bin/lthia_sum_counties.py?fipslist=39023,39109
/cgi-bin/lthia_sum_counties.py?fipslist=39109
/cgi-bin/lthia_sum_counties.py?fips1=39023
/cgi-bin/lthia_sum_counties.py?fips1=39023&fips2=39109
/cgi-bin/lthia_sum_counties.py?fips1=39109
                    

Path:

/cgi-bin/lthia_scenario_chain.py

Query Parameters:

Name Possible values Description
sessionid A short string containing characters to denote a sessionid for temporary files, useful while testing Determines the names of temporary geodatabase entries. Do not concurrently use the same session id for two simultaneous requests.
coords A pipe-bar separated list of comma separated Longitude,Latitude pairs The points must define a polygon. Determines the initial, overall bounds from which to fetch data to run LTHIA
changecoordsX, where X is a number starting at 1 counting up sequentially A pipe-bar separated list of comma separated Longitude,Latitude pairs The points must define a polygon. For each "usetypeX", this polygon is the area in which land-use values will be replaced with the new "usetype" ID.
changecoords A pipe-bar separated list of comma separated Longitude,Latitude pairs The points must define a polygon. This polygon is the default area in which land-use values will be replaced with the new "usetype" ID, if no "changecoordsX" is given. Never include the "changecoords" argument twice in the same query.
usetypeX, where X is a number starting at 1 counting up sequentially A land-use integer ID from the land-use table that is not provided here Determines which land use will be used for a replacement on the map

Notes:

If no "usetype1=24&changecoords1= -83.4293306587,43.1093973534|-83.4298674715,43.1095322567|-83.4299941965,43.1098185684" change scenarios are given, then the result of the script is simply the result of running LTHIA on the "coords" argument polygon.

The script requires either a set of changecoords1, changecoords2, etc. for each usetype1, usetype2, OR a changecoords default value with no number that applies to all usetypeX arguments without corresponding changecoords.

Across the different change sets being iterated, such as "changecoords1", "changecoords2", etc., the changes in the previous set will be remembered for the new set. This is why the script is called 'Scenario Chain'. This is a totally different behavior than the 'Multiple Single Scenarios' script. See diagram.

Legacy notes:

Analogous to the old script /cgi-bin/tipptlux.py

Diagram:

Chain Scenarios Diagram

Examples:

/cgi-bin/lthia_scenario_chain.py?sessionid=Projectbig3&coords= -83.4293306587,43.1093973534|-83.4298674715,43.1095322567|-83.4299941965,43.1098185684|-83.4296076737,43.1101984135|-83.4297016006,43.1109529007|-83.4300360889,43.1117085965|-83.4300136254,43.1118900617|-83.4300272922,43.1122398431|-83.4297632881,43.1123373291|-83.4292895578,43.1124838093|-83.4288664631,43.1128592202|-83.4288767252,43.1131219851|-83.4279722459,43.1138230459|-83.4277416756,43.1141629412|-83.4273038954,43.1143725123|-83.4266055779,43.1141574423|-83.4258946825,43.1136858403|-83.4252771664,43.1135868121|-83.4251690626,43.113399129|-83.4249373929,43.1130623288|-83.4251078186,43.1117762769|-83.4252487664,43.1115142996|-83.4254535811,43.1110768837|-83.4267456099,43.1110077773|-83.4271527654,43.1106940205|-83.4277002169,43.1104560282|-83.4289708517,43.1096746437|-83.4293306587,43.1093973534&changecoords=-83.42708270721293,43.1143408892082|-83.42622440032815,43.11387097002802|-83.42635314636087,43.11336971892523|-83.42721145324565,43.113181748703234|-83.42725436858989,43.11380831386469|-83.42708270721293,43.1143408892082&usetype1=241
/cgi-bin/lthia_scenario_chain.py?sessionid=Project17a&coords=-84.923,42.909|-84.746,42.893|-84.759,42.803|-84.935,42.823&changecoords1=-84.805,42.88|-84.778,42.88|-84.779,42.857|-84.805,42.857&usetype1=22&changecoords2=-84.913,42.863|-84.901,42.862|-84.902,42.831|-84.914,42.832&usetype2=232&changecoords3=-84.863,42.843|-84.809,42.843|-84.809,42.824|-84.863,42.824&usetype3=232&changecoords4=-84.913,42.899|-84.891,42.899|-84.891,42.884|-84.913,42.884&usetype4=22
                    

Path:

/cgi-bin/lthia_scenario_single.py

Query Parameters:

Name Possible values Description
sessionid A short string containing characters to denote a sessionid for temporary files, useful while testing Determines the names of temporary geodatabase entries. Do not concurrently use the same session id for two simultaneous requests.
coords A pipe-bar separated list of comma separated Longitude,Latitude pairs The points must define a polygon. Determines the initial, overall bounds from which to fetch data to run LTHIA
changecoordsX, where X is a number starting at 1 counting up sequentially A pipe-bar separated list of comma separated Longitude,Latitude pairs The points must define a polygon. For each "usetypeX", this polygon is the area in which land-use values will be replaced with the new "usetype" ID.
changecoords A pipe-bar separated list of comma separated Longitude,Latitude pairs The points must define a polygon. This polygon is the default area in which land-use values will be replaced with the new "usetype" ID, if no "changecoordsX" is given. Never include the "changecoords" argument twice in the same query.
usetypeX, where X is a number starting at 1 counting up sequentially A land-use integer ID from the land-use table that is not provided here Determines which land use will be used for a replacement on the map

Notes:

If no "usetype1=24&changecoords1= -83.4293306587,43.1093973534|-83.4298674715,43.1095322567|-83.4299941965,43.1098185684" change scenarios are given, then the result of the script is simply the result of running LTHIA on the "coords" argument polygon.

The script requires either a set of changecoords1, changecoords2, etc. for each usetype1, usetype2, OR a changecoords default value with no number that applies to all usetypeX arguments without corresponding changecoords.

Across the different change sets being iterated, such as "changecoords1", "changecoords2", etc., each change set is run as a totally unique scenario starting from the original LTHIA map data. See diagram.

Legacy notes:

Analogous to the old script /cgi-bin/msu3.py

Diagram:

Chain Scenarios Diagram

Examples:

/cgi-bin/lthia_scenario_chain.py?sessionid=Projectbig3&coords= -83.4293306587,43.1093973534|-83.4298674715,43.1095322567|-83.4299941965,43.1098185684|-83.4296076737,43.1101984135|-83.4297016006,43.1109529007|-83.4300360889,43.1117085965|-83.4300136254,43.1118900617|-83.4300272922,43.1122398431|-83.4297632881,43.1123373291|-83.4292895578,43.1124838093|-83.4288664631,43.1128592202|-83.4288767252,43.1131219851|-83.4279722459,43.1138230459|-83.4277416756,43.1141629412|-83.4273038954,43.1143725123|-83.4266055779,43.1141574423|-83.4258946825,43.1136858403|-83.4252771664,43.1135868121|-83.4251690626,43.113399129|-83.4249373929,43.1130623288|-83.4251078186,43.1117762769|-83.4252487664,43.1115142996|-83.4254535811,43.1110768837|-83.4267456099,43.1110077773|-83.4271527654,43.1106940205|-83.4277002169,43.1104560282|-83.4289708517,43.1096746437|-83.4293306587,43.1093973534&changecoords=-83.42708270721293,43.1143408892082|-83.42622440032815,43.11387097002802|-83.42635314636087,43.11336971892523|-83.42721145324565,43.113181748703234|-83.42725436858989,43.11380831386469|-83.42708270721293,43.1143408892082&usetype1=241
/cgi-bin/lthia_scenario_single.py?sessionid=Project18a&coords=-84.923,42.909|-84.746,42.893|-84.759,42.803|-84.935,42.823&changecoords1=-84.805,42.88|-84.778,42.88|-84.779,42.857|-84.805,42.857&usetype1=22&changecoords2=-84.913,42.863|-84.901,42.862|-84.902,42.831|-84.914,42.832&usetype2=232&changecoords3=-84.863,42.843|-84.809,42.843|-84.809,42.824|-84.863,42.824&usetype3=232&changecoords4=-84.913,42.899|-84.891,42.899|-84.891,42.884|-84.913,42.884&usetype4=22
                    

JSON

Path:

/cgi-bin/lthia_sum_huc12s_json.py

Query Parameters:

Name Possible values Description
huclist An comma-separated list of HUC12 codes, such as "050800012004,050800012003,050800012002" The list of HUC12 codes over which to run LTHIA and sum results
hucX, where X is a number starting at 1 counting up sequentially A single HUC12 code, such as "050800012004" One item in the list of HUC12 codes over which to run LTHIA and sum results

Notes:

Either the "huclist" argument, or many "hucX" arguments, such as "?huc1=050800012004&huc2=050800012003&huc3=050800012002", are required.

Legacy notes:

Analogous to the old scripts /cgi-bin/tippthuc.py and /cgi-bin/msu4.py BUT now the output is JSON format.

Examples:

/cgi-bin/lthia_sum_huc12s_json.py?huclist=050800012004
/cgi-bin/lthia_sum_huc12s_json.py?huclist=050800012004,050800012003
/cgi-bin/lthia_sum_huc12s_json.py?huclist=050800012003
/cgi-bin/lthia_sum_huc12s_json.py?huc1=050800012004
/cgi-bin/lthia_sum_huc12s_json.py?huc1=050800012004&huc2=050800012003
/cgi-bin/lthia_sum_huc12s_json.py?huc1=050800012003
                    

Path:

/cgi-bin/lthia_sum_counties_json.py

Query Parameters:

Name Possible values Description
fipslist An comma-separated list of 5-digit FIPS codes, such as "39023,39109,39021,39149" The list of 5-digit FIPS codes over which to run LTHIA and sum results
fipsX, where X is a number starting at 1 counting up sequentially A single 5-digit FIPS code, such as "39023" One item in the list of 5-digit FIPS codes over which to run LTHIA and sum results

Notes:

Either the "fipslist" argument, or many "fipsX" arguments, such as "?fips1=39023&fips2=39109&fips3=39021", are required.

Legacy notes:

This is a new script, no previous script was performing the same function.

Examples:

/cgi-bin/lthia_sum_counties_json.py?fipslist=39023
/cgi-bin/lthia_sum_counties_json.py?fipslist=39023,39109
/cgi-bin/lthia_sum_counties_json.py?fipslist=39109
/cgi-bin/lthia_sum_counties_json.py?fips1=39023
/cgi-bin/lthia_sum_counties_json.py?fips1=39023&fips2=39109
/cgi-bin/lthia_sum_counties_json.py?fips1=39109
                    

Path:

/cgi-bin/lthia_scenario_chain_json.py

Query Parameters:

Name Possible values Description
sessionid A short string containing characters to denote a sessionid for temporary files, useful while testing Determines the names of temporary geodatabase entries. Do not concurrently use the same session id for two simultaneous requests.
coords A pipe-bar separated list of comma separated Longitude,Latitude pairs The points must define a polygon. Determines the initial, overall bounds from which to fetch data to run LTHIA
changecoordsX, where X is a number starting at 1 counting up sequentially A pipe-bar separated list of comma separated Longitude,Latitude pairs The points must define a polygon. For each "usetypeX", this polygon is the area in which land-use values will be replaced with the new "usetype" ID.
changecoords A pipe-bar separated list of comma separated Longitude,Latitude pairs The points must define a polygon. This polygon is the default area in which land-use values will be replaced with the new "usetype" ID, if no "changecoordsX" is given. Never include the "changecoords" argument twice in the same query.
usetypeX, where X is a number starting at 1 counting up sequentially A land-use integer ID from the land-use table that is not provided here Determines which land use will be used for a replacement on the map

Notes:

If no "usetype1=24&changecoords1= -83.4293306587,43.1093973534|-83.4298674715,43.1095322567|-83.4299941965,43.1098185684" change scenarios are given, then the result of the script is simply the result of running LTHIA on the "coords" argument polygon.

The script requires either a set of changecoords1, changecoords2, etc. for each usetype1, usetype2, OR a changecoords default value with no number that applies to all usetypeX arguments without corresponding changecoords.

Across the different change sets being iterated, such as "changecoords1", "changecoords2", etc., the changes in the previous set will be remembered for the new set. This is why the script is called 'Scenario Chain'. This is a totally different behavior than the 'Multiple Single Scenarios' script. See diagram.

Legacy notes:

Analogous to the old script /cgi-bin/tipptlux.py BUT now the output is JSON format.

Diagram:

Chain Scenarios Diagram

Examples:

/cgi-bin/lthia_scenario_chain_json.py?sessionid=Projectbig3&coords= -83.4293306587,43.1093973534|-83.4298674715,43.1095322567|-83.4299941965,43.1098185684|-83.4296076737,43.1101984135|-83.4297016006,43.1109529007|-83.4300360889,43.1117085965|-83.4300136254,43.1118900617|-83.4300272922,43.1122398431|-83.4297632881,43.1123373291|-83.4292895578,43.1124838093|-83.4288664631,43.1128592202|-83.4288767252,43.1131219851|-83.4279722459,43.1138230459|-83.4277416756,43.1141629412|-83.4273038954,43.1143725123|-83.4266055779,43.1141574423|-83.4258946825,43.1136858403|-83.4252771664,43.1135868121|-83.4251690626,43.113399129|-83.4249373929,43.1130623288|-83.4251078186,43.1117762769|-83.4252487664,43.1115142996|-83.4254535811,43.1110768837|-83.4267456099,43.1110077773|-83.4271527654,43.1106940205|-83.4277002169,43.1104560282|-83.4289708517,43.1096746437|-83.4293306587,43.1093973534&changecoords=-83.42708270721293,43.1143408892082|-83.42622440032815,43.11387097002802|-83.42635314636087,43.11336971892523|-83.42721145324565,43.113181748703234|-83.42725436858989,43.11380831386469|-83.42708270721293,43.1143408892082&usetype1=241
/cgi-bin/lthia_scenario_chain_json.py?sessionid=Project17a&coords=-84.923,42.909|-84.746,42.893|-84.759,42.803|-84.935,42.823&changecoords1=-84.805,42.88|-84.778,42.88|-84.779,42.857|-84.805,42.857&usetype1=22&changecoords2=-84.913,42.863|-84.901,42.862|-84.902,42.831|-84.914,42.832&usetype2=232&changecoords3=-84.863,42.843|-84.809,42.843|-84.809,42.824|-84.863,42.824&usetype3=232&changecoords4=-84.913,42.899|-84.891,42.899|-84.891,42.884|-84.913,42.884&usetype4=22
                    

Path:

/cgi-bin/lthia_scenario_single_json.py

Query Parameters:

Name Possible values Description
sessionid A short string containing characters to denote a sessionid for temporary files, useful while testing Determines the names of temporary geodatabase entries. Do not concurrently use the same session id for two simultaneous requests.
coords A pipe-bar separated list of comma separated Longitude,Latitude pairs The points must define a polygon. Determines the initial, overall bounds from which to fetch data to run LTHIA
changecoordsX, where X is a number starting at 1 counting up sequentially A pipe-bar separated list of comma separated Longitude,Latitude pairs The points must define a polygon. For each "usetypeX", this polygon is the area in which land-use values will be replaced with the new "usetype" ID.
changecoords A pipe-bar separated list of comma separated Longitude,Latitude pairs The points must define a polygon. This polygon is the default area in which land-use values will be replaced with the new "usetype" ID, if no "changecoordsX" is given. Never include the "changecoords" argument twice in the same query.
usetypeX, where X is a number starting at 1 counting up sequentially A land-use integer ID from the land-use table that is not provided here Determines which land use will be used for a replacement on the map

Notes:

If no "usetype1=24&changecoords1= -83.4293306587,43.1093973534|-83.4298674715,43.1095322567|-83.4299941965,43.1098185684" change scenarios are given, then the result of the script is simply the result of running LTHIA on the "coords" argument polygon.

The script requires either a set of changecoords1, changecoords2, etc. for each usetype1, usetype2, OR a changecoords default value with no number that applies to all usetypeX arguments without corresponding changecoords.

Across the different change sets being iterated, such as "changecoords1", "changecoords2", etc., each change set is run as a totally unique scenario starting from the original LTHIA map data. See diagram.

Legacy notes:

Analogous to the old script /cgi-bin/msu3.py BUT now the output is JSON format.

Diagram:

Chain Scenarios Diagram

Examples:

/cgi-bin/lthia_scenario_chain_json.py?sessionid=Projectbig3&coords= -83.4293306587,43.1093973534|-83.4298674715,43.1095322567|-83.4299941965,43.1098185684|-83.4296076737,43.1101984135|-83.4297016006,43.1109529007|-83.4300360889,43.1117085965|-83.4300136254,43.1118900617|-83.4300272922,43.1122398431|-83.4297632881,43.1123373291|-83.4292895578,43.1124838093|-83.4288664631,43.1128592202|-83.4288767252,43.1131219851|-83.4279722459,43.1138230459|-83.4277416756,43.1141629412|-83.4273038954,43.1143725123|-83.4266055779,43.1141574423|-83.4258946825,43.1136858403|-83.4252771664,43.1135868121|-83.4251690626,43.113399129|-83.4249373929,43.1130623288|-83.4251078186,43.1117762769|-83.4252487664,43.1115142996|-83.4254535811,43.1110768837|-83.4267456099,43.1110077773|-83.4271527654,43.1106940205|-83.4277002169,43.1104560282|-83.4289708517,43.1096746437|-83.4293306587,43.1093973534&changecoords=-83.42708270721293,43.1143408892082|-83.42622440032815,43.11387097002802|-83.42635314636087,43.11336971892523|-83.42721145324565,43.113181748703234|-83.42725436858989,43.11380831386469|-83.42708270721293,43.1143408892082&usetype1=241
/cgi-bin/lthia_scenario_single_json.py?sessionid=Project18a&coords=-84.923,42.909|-84.746,42.893|-84.759,42.803|-84.935,42.823&changecoords1=-84.805,42.88|-84.778,42.88|-84.779,42.857|-84.805,42.857&usetype1=22&changecoords2=-84.913,42.863|-84.901,42.862|-84.902,42.831|-84.914,42.832&usetype2=232&changecoords3=-84.863,42.843|-84.809,42.843|-84.809,42.824|-84.863,42.824&usetype3=232&changecoords4=-84.913,42.899|-84.891,42.899|-84.891,42.884|-84.913,42.884&usetype4=22