コード例 #1
0
ファイル: item.c プロジェクト: noradtux/navit-webos
int
item_coord_get_pro(struct item *it, struct coord *c, int count, enum projection to)
{
	int ret=item_coord_get(it, c, count);
	int i;
	enum projection from=map_projection(it->map);
	if (from != to) 
		for (i = 0 ; i < count ; i++) 
			transform_from_to(c+i, from, c+i, to);
	return ret;
}
コード例 #2
0
ファイル: shapefile.c プロジェクト: PDXostc/navit
static void
shapefile_coord(struct map_rect_priv *mr, int idx, struct coord *c)
{
	SHPObject *psShape=mr->psShape;
	struct coord cs;
	struct coord_geo g;

	if (!mr->m->pro) {
		g.lng=psShape->padfX[idx]+mr->m->offset.x;
		g.lat=psShape->padfY[idx]+mr->m->offset.y;
		transform_from_geo(projection_mg, &g, c);
	} else {
		cs.x=psShape->padfX[idx]+mr->m->offset.x;
		cs.y=psShape->padfY[idx]+mr->m->offset.y;
		transform_from_to(&cs, mr->m->pro, c, projection_mg);
	}
}