Получение описывающего прямоугольника для объекта.
#include <gis/gis_raw.h>int gis_data_raw_object_get_bounding_rect( gis_data_raw_context_t ctx, gis_borders_t *bounding_rect );
gishelper
Функция получает градусные границы описывающего прямоугольника для объекта.
gis_object_t object;gis_data_raw_context_t raw_ctx;gis_object_init( &object );gis_core_connection_t connection;gis_core_request_parameters_t map;gis_core_link_init( &connection );gis_core_link_connect( &connection, 777 );gis_core_databuffer_attach( &connection );gis_core_request_parameters_init( &map );gis_core_databuffer_data_request( &connection, &map, 1 );gis_data_raw_ctx_alloc( &raw_ctx );gis_data_raw_ctx_import_databuffer( raw_ctx );gis_core_map_list_t map_list;gis_core_map_list_init( &map_list );gis_core_request_maps_list( &connection, &map, GIS_CORE_DRIVERS_SXF_LOCAL, &map_list );gis_data_raw_select_map( raw_ctx, GIS_CORE_DRIVERS_SXF_LOCAL, map_list.entry_list[0].id );gis_data_raw_map_select_first_object( raw_ctx );gis_data_raw_object_get_bounding_rect( raw_ctx, &object.bounding_rect );if ( fabs ( object.bounding_rect.degrees.west - 39.997025 < 0.0001 ) &&fabs ( object.bounding_rect.degrees.east - 39.998626 < 0.0001 ) &&fabs ( object.bounding_rect.degrees.north - 43.506432 < 0.0001 ) &&fabs ( object.bounding_rect.degrees.south - 43.500663 < 0.0001 ) ){printf("Correct\n" );}else{printf("Incorrect degree coordinates: %lf %lf %lf %lf\n", object.bounding_rect.degrees.west, object.bounding_rect.degrees.east,object.bounding_rect.degrees.north, object.bounding_rect.degrees.south );gis_data_raw_ctx_free( &raw_ctx );gis_object_free( &object );gis_core_map_list_free( &map_list );gis_core_databuffer_detach();gis_core_link_destroy( &connection, true );return 1;}gis_data_raw_ctx_free( &raw_ctx );gis_object_free( &object );gis_core_map_list_free( &map_list );gis_core_databuffer_detach();gis_core_link_destroy( &connection, true );
ПК ЦКИ для ЗОСРВ «Нейтрино»
1.1.0
gis_data_raw_context_t, gis_borders_t
Предыдущий раздел: Описание API картографического фреймворка