Skip to content

Commit

Permalink
Merge branch 'master' of github.com:mapserver/mapserver
Browse files Browse the repository at this point in the history
  • Loading branch information
unicolet committed Oct 18, 2012
2 parents aaed141 + b8e6e0c commit 2aedaba
Show file tree
Hide file tree
Showing 12 changed files with 38 additions and 14 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Expand Up @@ -19,6 +19,12 @@ mapscript/python/build/
mapscript/python/mapscript.py
mapscript/python/mapscript_wrap.c
mapscript/php/php_mapscript.la
mapscript/java/edu
mapscript/java/javamapscript_wrap.c
mapscript/java/libjavamapscript.la
mapscript/java/mapscript.jar
mapscript/perl/MYMETA.yml
mapscript/perl/Makefile.old
mapscriptvars
mapserv
mapserver-config
Expand Down
13 changes: 13 additions & 0 deletions mapcairo.c
Expand Up @@ -840,6 +840,18 @@ int saveImageCairo(imageObj *img, mapObj *map, FILE *fp, outputFormatObj *format
return MS_SUCCESS;
}

unsigned char* saveImageBufferCairo(imageObj *img, int *size_ptr, outputFormatObj *format)
{
cairo_renderer *r = CAIRO_RENDERER(img);
unsigned char *data;
assert(!strcasecmp(img->format->driver,"cairo/pdf") || !strcasecmp(img->format->driver,"cairo/svg"));
cairo_surface_finish (r->surface);
data = msSmallMalloc(r->outputStream->size);
memcpy(data,r->outputStream->data,r->outputStream->size);
*size_ptr = (int)r->outputStream->size;
return data;
}

void *msCreateTileEllipseCairo(double width, double height, double angle,
colorObj *c, colorObj *bc, colorObj *oc, double ow)
{
Expand Down Expand Up @@ -1252,6 +1264,7 @@ inline int populateRendererVTableCairoVector( rendererVTableObj *renderer )
renderer->renderLineTiled = NULL;
renderer->createImage=&createImageCairo;
renderer->saveImage=&saveImageCairo;
renderer->saveImageBuffer = &saveImageBufferCairo;
renderer->getRasterBufferHandle=&getRasterBufferHandleCairo;
renderer->renderPolygon=&renderPolygonCairo;
renderer->renderGlyphs=&renderGlyphsCairo;
Expand Down
5 changes: 3 additions & 2 deletions mapfile.c
Expand Up @@ -2941,13 +2941,14 @@ void writeStyle(FILE *stream, int indent, styleObj *style)
writeNumber(stream, indent, "INITIALGAP", -1, style->initialgap);

if(style->_geomtransform.type != MS_GEOMTRANSFORM_NONE) {
writeKeyword(stream, indent, "GEOMTRANSFORM", style->_geomtransform.type, 6,
writeKeyword(stream, indent, "GEOMTRANSFORM", style->_geomtransform.type, 7,
MS_GEOMTRANSFORM_BBOX, "\"bbox\"",
MS_GEOMTRANSFORM_END, "\"end\"",
MS_GEOMTRANSFORM_LABELPOINT, "\"labelpnt\"",
MS_GEOMTRANSFORM_LABELPOLY, "\"labelpoly\"",
MS_GEOMTRANSFORM_START, "\"start\"",
MS_GEOMTRANSFORM_VERTICES, "\"vertices\""
MS_GEOMTRANSFORM_VERTICES, "\"vertices\"",
MS_GEOMTRANSFORM_CENTROID, "\"centroid\""
);
}

Expand Down
6 changes: 3 additions & 3 deletions mapprimitive.c
Expand Up @@ -1709,14 +1709,14 @@ void msPolylineLabelPointLineString(shapeObj *p, int min_length, int repeat_dist

if(anglemode != MS_NONE) {
theta = atan2(p->line[i].point[j].x - p->line[i].point[j-1].x, p->line[i].point[j].y - p->line[i].point[j-1].y);
if(anglemode == MS_AUTO) {
if(anglemode == MS_AUTO2) {
*(*angles)[index] = (MS_RAD_TO_DEG*theta) - 90;
} else { /* AUTO, FOLLOW */
if(p->line[i].point[j-1].x < p->line[i].point[j].x) { /* i.e. to the left */
*(*angles)[index] = (MS_RAD_TO_DEG*theta) - 90;
} else {
*(*angles)[index] = (MS_RAD_TO_DEG*theta) + 90;
}
} else { /* AUTO2 */
*(*angles)[index] = (MS_RAD_TO_DEG*theta) - 90;
}
}

Expand Down
4 changes: 2 additions & 2 deletions mapscript/java/javamodule.i
Expand Up @@ -211,12 +211,12 @@ RFC-24 implementation follows
return clazz;
}

%typemap(javacode) layerObj %{
%typemap(javacode) struct layerObj %{
/* parent reference, RFC-24 item 3.2 */
mapObj map=null;
%}

%typemap(javacode) classObj %{
%typemap(javacode) struct classObj %{
/* parent reference, RFC-24 item 3.2 */
layerObj layer=null;
%}
2 changes: 1 addition & 1 deletion mapscript/python/tests/cases/imagetest.py
Expand Up @@ -128,7 +128,7 @@ def testConstructorStringIO(self):

def testConstructorUrlStream(self):
"""imageObj with a URL stream works"""
url = urllib.urlopen('http://mapserver.gis.umn.edu/logo.jpg')
url = urllib.urlopen('http://mapserver.org/_static/banner.png')
imgobj = mapscript.imageObj(url, 'GD/JPEG')
assert imgobj.thisown == 1
assert imgobj.height == 68
Expand Down
2 changes: 1 addition & 1 deletion mapscript/python/tests/cases/threadtest.py
Expand Up @@ -159,7 +159,7 @@ def draw_map_wms(name, save=0):
lo.setProjection('+init=epsg:4326')
lo.connectiontype = mapscript.MS_WMS
# lo.connection = 'http://wms.jpl.nasa.gov/wms.cgi?'
lo.connection = 'http://labs.metacarta.com/wms/vmap0?'
lo.connection = 'http://vmap0.tiles.osgeo.org/wms/vmap0?'
lo.metadata.set('wms_service', 'WMS')
lo.metadata.set('wms_server_version', '1.1.1')
lo.metadata.set('wms_name', 'basic')
Expand Down
3 changes: 2 additions & 1 deletion mapscript/ruby/extconf.rb
Expand Up @@ -13,7 +13,8 @@
$CFLAGS = ""
$CPPFLAGS = make_inc + " -idirafter $(rubylibdir)/$(arch) " + make_define
$LDFLAGS += " -fPIC"
$LOCAL_LIBS += " -L../../.libs/ " + " -lmapserver " + make_static_libs
#$LOCAL_LIBS += " -L../../.libs/ " + " -lmapserver " + make_static_libs
$LOCAL_LIBS += " -L../../.libs/ " + " -lmapserver "

# if the source file 'mapscript_wrap.c' is missing nothing works
# this is a workaround !!
Expand Down
4 changes: 3 additions & 1 deletion mapserver.h
Expand Up @@ -172,11 +172,13 @@ typedef ms_uint32 * ms_bitarray;
extern "C" {
#endif

// hide from swig or ruby will choke on the __FUNCTION__ name
#ifndef SWIG
/* Memory allocation check utility */

#ifndef __FUNCTION__
# define __FUNCTION__ "MapServer"
#endif
#endif

#define MS_CHECK_ALLOC(var, size, retval) \
if (!var) { \
Expand Down
4 changes: 2 additions & 2 deletions mapwms.c
Expand Up @@ -857,10 +857,10 @@ int msWMSLoadGetMapParams(mapObj *map, int nVersion,

layers = msStringSplit(values[i], ',', &numlayers);
if (layers==NULL || strlen(values[i]) <=0 || numlayers < 1) {
msFreeCharArray(layers,numlayers);
msFree(layerOrder);
numlayers = 0;
if (sld_url == NULL && sld_body == NULL) {
msFreeCharArray(layers,numlayers);
msFree(layerOrder);
msSetError(MS_WMSERR, "At least one layer name required in LAYERS.",
"msWMSLoadGetMapParams()");
return msWMSException(map, nVersion, NULL, wms_exception_format);
Expand Down
2 changes: 1 addition & 1 deletion msautotest
Submodule msautotest updated from 53b128 to a8d3ec
1 change: 1 addition & 0 deletions tests/test.map
Expand Up @@ -40,6 +40,7 @@ MAP
"key2" "value2"
"key3" "value3"
"key4" "value4"
"ows_enable_request" "*"
END
END

Expand Down

0 comments on commit 2aedaba

Please sign in to comment.