Download OpenStreetMap Buildings
LightOSM.download_osm_buildings
— Functiondownload_osm_buildings(download_method::Symbol;
metadata::Bool=false,
download_format::Symbol=:osm,
save_to_file_location::Union{String,Nothing}=nothing,
download_kwargs...
)::Union{XMLDocument,Dict{String,Any}}
Downloads OpenStreetMap buildings data by querying with a place name, bounding box, or centroid point.
Arguments
download_method::Symbol
: Download method, choose from:place_name
,:bbox
or:point
.metadata::Bool=false
: Set true to return metadata.download_format::Symbol=:osm
: Download format, either:osm
,:xml
orjson
.save_to_file_location::Union{String,Nothing}=nothing
: Specify a file location to save downloaded data to disk.
Required Download Kwargs
download_method=:place_name
place_name::String
: Any place name string used as a search argument to the Nominatim API.
download_method=:bbox
minlat::AbstractFloat
: Bottom left bounding box latitude coordinate.minlon::AbstractFloat
: Bottom left bounding box longitude coordinate.maxlat::AbstractFloat
: Top right bounding box latitude coordinate.maxlon::AbstractFloat
: Top right bounding box longitude coordinate.
download_method=:point
point::GeoLocation
: Centroid point to draw the bounding box around.radius::Number
: Distance (km) from centroid point to each bounding box corner.
Return
Union{XMLDocument,Dict{String,Any}}
: OpenStreetMap buildings data parsed as either XML or Dictionary object depending on the download method.
LightOSM.osm_buildings_from_place_name
— Functionosm_buildings_from_place_name(;place_name::String,
metadata::Bool=false,
download_format::Symbol=:osm
)::String
Downloads OpenStreetMap buildings using any place name string.
Arguments
place_name::String
: Any place name string used as a search argument to the Nominatim API.metadata::Bool=false
: Set true to return metadata.download_format::Symbol=:osm
: Download format, either:osm
,:xml
orjson
.
Return
String
: OpenStreetMap buildings data response string.
LightOSM.osm_buildings_from_point
— Functionosm_buildings_from_point(;point::GeoLocation,
radius::Number,
metadata::Bool=false,
download_format::Symbol=:osm
)::String
Downloads OpenStreetMap buildings using bounding box coordinates calculated from a centroid point and radius (km).
Arguments
point::GeoLocation
: Centroid point to draw the bounding box around.radius::Number
: Distance (km) from centroid point to each bounding box corner.metadata::Bool=false
: Set true to return metadata.download_format::Symbol=:osm
: Download format, either:osm
,:xml
orjson
.
Return
String
: OpenStreetMap buildings data response string.
LightOSM.osm_buildings_from_bbox
— Functionosm_buildings_from_bbox(;minlat::AbstractFloat,
minlon::AbstractFloat,
maxlat::AbstractFloat,
maxlon::AbstractFloat,
metadata::Bool=false,
download_format::Symbol=:osm
)::String
Downloads OpenStreetMap buildings using bounding box coordinates.
Arguments
minlat::AbstractFloat
: Bottom left bounding box latitude coordinate.minlon::AbstractFloat
: Bottom left bounding box longitude coordinate.maxlat::AbstractFloat
: Top right bounding box latitude coordinate.maxlon::AbstractFloat
: Top right bounding box longitude coordinate.metadata::Bool=false
: Set true to return metadata.download_format::Symbol=:osm
: Download format, either:osm
,:xml
orjson
.
Return
String
: OpenStreetMap buildings data response string.