I am looking for coordinates (longitude and latitude) of each state of Brazil. Where can I find that?
I have found a file for the US states here: http://econym.org.uk/gmap/states.xml, I am now looking for something similar for Brazil.
I am looking for coordinates (longitude and latitude) of each state of Brazil. Where can I find that?
I have found a file for the US states here: http://econym.org.uk/gmap/states.xml, I am now looking for something similar for Brazil.
When it comes to getting data about administrative boundaries of Brazil (and other types of public GIS data in the country), I advise looking first in the website of Brazilian Institute of Geography and Statistics (aka IBGE). The institute is responsible to make the survey and keep the data updated. Most of these data can be found in https://geoftp.ibge.gov.br/ (folder and filenames are in Portuguese).
The information you want can be found here:
https://geoftp.ibge.gov.br/organizacao_do_territorio/malhas_territoriais/malhas_municipais/municipio_2020/Brasil/BR/. This is the link for 2020 data (previous years are available in parent directories).
Download the file named: br_unidades_federacao.zip
(which means Brazil's states). The other files in that folder are mesoregion, microregion and county administrative boundaries.
The CRS adopted in IBGE's shapefiles is SIRGAS 2000 (EPSG:4674).
You could take a look at the Global Administrative Boundaries project. Several different formats to choose from, and you can select the level at which you'd like boundaries (for states, you might just need level 0).
When I ran through this workflow, I selected KMZ format and level 2, extracted the KML file via 7-zip, and used this service to get the coordinates in CSV. YMMV using this approach and especially that web service, but hopefully it gets you on your way.
I need a format I can read with my python program, so xml or json would be a good choice. I don't know geojson.
You can download any data format, such as a shapefile, of the borders. Then open that dataset in QGIS, and export it to GeoJSON (or download GeoJSON right away). Then right-click that .geojson file and open it in any text-editor, such as Notepad++. You will now see each vertex (i.e. coordinate) in that dataset (attention: the coordinates are in the coordinate system that you have used, so if you need to see lat/lon coordinates, make sure to save the dataset as WGS84 - EPSG:4326). If you do not have access to QGIS you can also use different online converters; there are a few out there.
The OSM boundaries application https://wambachers-osm.website/boundaries provides downloads of borders of administrative units that are mappen in OpenStreetMap. Maybe that will be of use to you.