Permalink
Browse files

proposed implementation

  • Loading branch information...
1 parent 14d78b7 commit d059db31038939e8322cd7071e579ff46dd03a1e @unicolet unicolet committed Jan 18, 2013
Showing with 39 additions and 1 deletion.
  1. +2 −1 mapscript/java/Makefile.in
  2. +25 −0 mapscript/java/examples/OutputFormatList.java
  3. +10 −0 mapscript/swiginc/map.i
  4. +2 −0 mapserver.h
@@ -82,13 +82,14 @@ clean:
ifneq ($(findstring PROJ, $(DEFINES)),)
ifneq ($(findstring GDAL, $(DEFINES)),)
test:
- $(JAVAC) -classpath ./:examples/:./mapscript.jar -d examples/ examples/RFC24.java examples/ConnPool.java examples/DrawMap.java examples/DumpShp.java examples/MakePoint.java examples/QueryByAttribute.java examples/ShapeInfo.java examples/WxSTest.java examples/Metadata.java examples/RunTimeBuiltWMSClient.java
+ $(JAVAC) -classpath ./:examples/:./mapscript.jar -d examples/ examples/RFC24.java examples/ConnPool.java examples/DrawMap.java examples/DumpShp.java examples/MakePoint.java examples/QueryByAttribute.java examples/ShapeInfo.java examples/WxSTest.java examples/Metadata.java examples/RunTimeBuiltWMSClient.java examples/OutputFormatList.java
$(JAVAC) -encoding utf8 -classpath ./:examples/:./mapscript.jar -d examples/ examples/QueryByAttributeUnicode.java
$(JAVA) -classpath ./:examples/:./mapscript.jar -Djava.library.path=.libs/ DumpShp ../../tests/point.shp
$(JAVA) -classpath ./:examples/:./mapscript.jar -Djava.library.path=.libs/ ShapeInfo ../../tests/point.shp ../../tests/point.dbf
$(JAVA) -classpath ./:examples/:./mapscript.jar -Djava.library.path=.libs/ DrawMap ../../tests/test.map ./map.png
$(JAVA) -classpath ./:examples/:./mapscript.jar -Djava.library.path=.libs/ ConnPool
$(JAVA) -classpath ./:examples/:./mapscript.jar -Djava.library.path=.libs/ QueryByAttribute ../../tests/test.map
+ $(JAVA) -classpath ./:examples/:./mapscript.jar -Djava.library.path=.libs/ OutputFormatList ../../tests/test.map
ifneq ($(findstring USE_WCS_SVR, $(DEFINES)),)
$(JAVA) -classpath ./:examples/:./mapscript.jar -Djava.library.path=.libs/ WxSTest ../../tests/test.map
else
@@ -0,0 +1,25 @@
+import edu.umn.gis.mapscript.*;
+
+/**
+ * <p>Title: Mapscript outputformat dump example.</p>
+ * @author Umberto Nicoletti umberto.nicoletti@gmail.com
+ * @version 1.0
+ */
+
+public class OutputFormatList {
+
+ public static void usage() {
+ System.err.println("Usage: OutputFormatList {mapfile}");
+ System.exit(-1);
+ }
+
+ public static void main(String[] args) {
+ if (args.length != 1) usage();
+
+ mapObj map = new mapObj(args[0]);
+ for (int i=0; i<map.getNumoutputformats(); i++) {
+ outputFormatObj format = map.getOutputFormat(i);
+ System.out.println("["+i+"] Format name: "+format.getName());
+ }
+ }
+}
@@ -184,6 +184,16 @@
MS_NOOVERRIDE, MS_NOOVERRIDE );
}
}
+
+ %newobject getOutputFormat;
+ outputFormatObj *getOutputFormat(int i) {
+ if(i >= 0 && i < self->numoutputformats) {
+ return (self->outputformatlist[i]);
+ } else {
+ return NULL;
+ }
+ }
+
void setOutputFormat( outputFormatObj *format ) {
msApplyOutputFormat( &(self->outputformat), format, MS_NOOVERRIDE,
View
@@ -1699,7 +1699,9 @@ extern "C" {
%immutable;
#endif /* SWIG */
int numoutputformats;
+#ifndef SWIG
outputFormatObj **outputformatlist;
+#endif /*SWIG*/
outputFormatObj *outputformat;
char *imagetype; /* name of current outputformat */

0 comments on commit d059db3

Please sign in to comment.