327 PJ *pj_source_crs = proj_get_source_crs(NULL, pj);
328 uint8_t source_is_latlong =
LW_FALSE;
329 double out_semi_major_metre = DBL_MAX, out_semi_minor_metre = DBL_MAX;
333 lwerror(
"%s: unable to access source crs", __func__);
339 if (!extra_geography_data)
341 proj_destroy(pj_source_crs);
346 double out_inv_flattening;
347 int out_is_semi_minor_computed;
349 PJ_TYPE pj_type = proj_get_type(pj_source_crs);
350 if (pj_type == PJ_TYPE_UNKNOWN)
352 proj_destroy(pj_source_crs);
353 lwerror(
"%s: unable to access source crs type", __func__);
356 source_is_latlong = (pj_type == PJ_TYPE_GEOGRAPHIC_2D_CRS) || (pj_type == PJ_TYPE_GEOGRAPHIC_3D_CRS);
358 pj_ellps = proj_get_ellipsoid(NULL, pj_source_crs);
359 proj_destroy(pj_source_crs);
362 lwerror(
"%s: unable to access source crs ellipsoid", __func__);
365 if (!proj_ellipsoid_get_parameters(NULL,
367 &out_semi_major_metre,
368 &out_semi_minor_metre,
369 &out_is_semi_minor_computed,
370 &out_inv_flattening))
372 proj_destroy(pj_ellps);
373 lwerror(
"%s: unable to access source crs ellipsoid parameters", __func__);
376 proj_destroy(pj_ellps);
379 PJ *pj_target_crs = proj_get_target_crs(NULL, pj);
382 lwerror(
"%s: unable to access target crs", __func__);
386 proj_destroy(pj_target_crs);
void * lwalloc(size_t size)
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
uint8_t source_is_latlong
double source_semi_major_metre
double source_semi_minor_metre