GeographicZoneDetector

Thanks to anyone who can help. I’m trying to get ground track passes on a polygon I’ve defined using coordinates, but I can’t understand why no events are being recorded.

This is my polygon:

# Poligono counterclockwise 
polygon_coords = [
    (8.5, 38.5), (15.2, 36.3), (18.9, 40.2),
    (13.8, 43.7), (14.0, 46.6), (12.0, 47.3),
    (7.8, 46.4), (6.5, 45.5), (8.0, 39.0)
]

poly_lon, poly_lat = zip(*polygon_coords)
polygon_coords = list(zip(poly_lon, poly_lat))

This is my Earth

# Create a planet to map positions on
earth = OneAxisEllipsoid(
    Constants.WGS84_EARTH_EQUATORIAL_RADIUS,                    # equatorial radius
    Constants.WGS84_EARTH_FLATTENING,                           # flattening
    FramesFactory.getITRF(IERSConventions.IERS_2010, True)      # bodyFrame (International Terrestrial Reference Frame)
)

This is my ground track

pv = [eck_prop.propagate(tt).getPVCoordinates() for tt in t]
p = [tpv.getPosition() for tpv in pv]
subpoint = [earth.transform(tp, inertialFrame, tt) for tt, tp in zip(t, p)]
lat = np.degrees([gp.getLatitude() for gp in subpoint])
lon = np.degrees([gp.getLongitude() for gp in subpoint])

Here is how is used GeographicZoneDetector

# Build Region_Polygon 
geodeticPoints = [GeodeticPoint(radians(lat), radians(lon), 0.0)
                  for lon, lat in polygon_coords]  # nota: lat prima, lon dopo
region_polygon = EllipsoidTessellator.buildSimpleZone(1.0e-7, geodeticPoints)  

# Add detector and logger
countryDetector = GeographicZoneDetector(earth, region_polygon, 0.0).withHandler(ContinueOnEvent())
zoneLogger = EventsLogger()
logged_detector = zoneLogger.monitorDetector(countryDetector)  

eck_prop.addEventDetector(logged_detector) 
eck_prop.propagate(t[0], t[-1])

events = zoneLogger.getLoggedEvents()

The problem is that events contain only 1 event, but looking at the ground track i should have different events. Can anyone help me ? Thanks

I think you region is defined clockwise, so you are perhaps asking for everything on Earth except the region you are interested in.

Each point in polygon_cords is (lat,lon). This polygon is anticlockwise. But also if I look when is outside is not possible that I have no results.