How to convert Multiploygon to single latitude and longitude to mark in map

Hi, I am new to GIS,

How to convert Multiploygon to single latitude and longitude to mark in map.

 coordinates = [get_coordinates_from_str(coord) for coord in coordinates_list]

polygon = Polygon(coordinates)
centroid_x, centroid_y = polygon.centroid.x, polygon.centroid.y

 transformer = Transformer.from_crs('EPSG:32630', "EPSG:3857", always_xy=True)
centroid_lon, centroid_lat = transformer.transform(centroid_x, centroid_y)

For some layer it worked, But some layer the latitude and longitude is wrong.

If by sometimes the lat and lon is wrong you mean they’re outside the polygon, that can certainly happen when computing the centroid. Note centroid is not the same as interior point (it’s the “center of mass” so it can lie outside for concave polygons, like in for a boomerang). The JTS library has a Geometry,getInteriorPoint():Coordinate method for what you’re looking for: https://locationtech.github.io/jts/javadoc/org/locationtech/jts/geom/Geometry.html#getInteriorPoint–

On the other hand, you’re transforming from EPSG:32630, which is an UTM projection and hence has a small area of validity compared to the target web mercator that covers the whole world, so are you sure the input coordinates are correct?