if (priv->point != NULL)
{
- item = goo_canvas_rect_new (NULL,
- priv->point->x, priv->point->y,
- 1 / scale->x, 1 / scale->y,
- "line-width", 1.0 / scale->xy,
- NULL);
+ item = goo_canvas_ellipse_new (NULL,
+ priv->point->x, priv->point->y,
+ 0.5 / scale->x, 0.5 / scale->y,
+ "line-width", 0.5 / scale->xy,
+ "fill-color", "black",
+ NULL);
}
return item;
struct _GtkGisLayerSourcePrivate
{
OGRDataSourceH datasource;
+
+ GtkGisLayerExtent *max_extent;
};
G_DEFINE_TYPE (GtkGisLayerSource, gtk_gis_layer_source, G_TYPE_OBJECT)
GtkGisLayerSourcePrivate *priv = GTK_GIS_LAYER_SOURCE_GET_PRIVATE (source);
priv->datasource = datasource;
+
+ priv->max_extent = NULL;
}
OGRLayerH layer;
OGRFeatureH feature;
- GtkGisLayerExtent extent;
-
OGRGeometryH poGeometry;
GtkGisGeometry *geometry;
+ gdouble fixy;
+
GtkGisLayerSourcePrivate *priv = GTK_GIS_LAYER_SOURCE_GET_PRIVATE (source);
g_return_if_fail (priv->datasource != NULL);
g_return_if_fail (layer != NULL);
- extent = gtk_gis_layer_source_get_layer_extent (source, name);
-
OGR_L_ResetReading (layer);
+ /*if (priv->max_extent == NULL)
+ {
+ fixy = 0.0f;
+ }
+ else
+ {*/
+ fixy = priv->max_extent->max_y + priv->max_extent->min_y;
+ //}
+
while ((feature = OGR_L_GetNextFeature (layer)) != NULL)
{
poGeometry = OGR_F_GetGeometryRef (feature);
GtkGisPoint gpoint;
gpoint.x = OGR_G_GetX (poGeometry, 0);
- gpoint.y = extent.max_y - OGR_G_GetY (poGeometry, 0) + extent.min_y;
+ gpoint.y = fixy - OGR_G_GetY (poGeometry, 0);
geometry = gtk_gis_geometry_point_new (gpoint);
}
gpoint = g_malloc0 (sizeof (GtkGisPoint));
gpoint->x = OGR_G_GetX (poGeometry, point);
- gpoint->y = extent.max_y - OGR_G_GetY (poGeometry, point) + extent.min_y;
+ gpoint->y = fixy - OGR_G_GetY (poGeometry, point);
gpoints = g_slist_append (gpoints, gpoint);
}
gpoint = g_malloc0 (sizeof (GtkGisPoint));
gpoint->x = OGR_G_GetX (poGeometryInt, point);
- gpoint->y = extent.max_y - OGR_G_GetY (poGeometryInt, point) + extent.min_y;
+ gpoint->y = fixy - OGR_G_GetY (poGeometryInt, point);
gpoints = g_slist_append (gpoints, gpoint);
}
return extent;
}
+void
+gtk_gis_layer_source_set_max_extent (GtkGisLayerSource *source,
+ GtkGisLayerExtent *extent)
+{
+ GtkGisLayerSourcePrivate *priv = GTK_GIS_LAYER_SOURCE_GET_PRIVATE (source);
+
+ if (priv->max_extent == NULL)
+ {
+ priv->max_extent = g_malloc0 (sizeof (GtkGisLayerExtent));
+ }
+
+ priv->max_extent->min_x = extent->min_x;
+ priv->max_extent->max_x = extent->max_x;
+ priv->max_extent->min_y = extent->min_y;
+ priv->max_extent->max_y = extent->max_y;
+}
+
static void
gtk_gis_layer_source_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec)
{