Commit 87da037e authored by Paul Ramsey's avatar Paul Ramsey

Added GNU autoconf support files submitted by Norman Vine. Moved test

files to a new subdirectory.


git-svn-id: http://svn.osgeo.org/geos/trunk@22 5242fede-7e19-0410-aef8-94bd7d2200fb
parent af4b306f
SUBDIRS = source
#!/bin/sh
OSTYPE=`uname -s`
AMFLAGS="--add-missing --copy --force-missing"
if test "$OSTYPE" = "IRIX" -o "$OSTYPE" = "IRIX64"; then
AMFLAGS=$AMFLAGS" --include-deps";
fi
echo "Running aclocal"
aclocal
echo "Running automake"
automake $AMFLAGS
echo "Running autoconf"
autoconf
echo "======================================"
echo "Now you are ready to run './configure'"
echo "======================================"
dnl Process this file with autoconf to produce a configure script.
AC_INIT(source/io/markup/MarkupSTL.h)
# Initialize the automake stuff
AM_INIT_AUTOMAKE(GEOS, 0.0.1)
dnl Checks for programs.
AC_PROG_CC
AC_PROG_MAKE_SET
AC_PROG_CC
AC_PROG_CXX
AC_PROG_RANLIB
AC_PROG_INSTALL
AC_PROG_LN_S
# Initialize libtool
# AM_PROG_LIBTOOL
# Initialize maintainer mode
# AM_MAINTAINER_MODE
# This is needed for AC_TRY_COMPILE later
# AC_ISC_POSIX
# Check to see if this `configure' is being run in the `Cygwin32' environment
# AM_CYGWIN32
# Determine version of automake ... important for now
AUTO_MAKE_VERSION=`automake --version | head -1 | awk '{print $4}' | sed -e 's/\.//'`
dnl Checks for programs.
dnl Checks for libraries.
dnl Checks for header files.
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
dnl Checks for library functions.
AC_OUTPUT( Makefile \
source/Makefile \
source/geom/Makefile \
source/graph/Makefile \
source/graph/index/Makefile \
source/io/Makefile \
source/io/markup/Makefile \
source/test/Makefile \
source/util/Makefile \
)
\ No newline at end of file
// CTS.cpp : Testing class
//
#include "io.h"
#include <iostream>
using namespace std;
/*
int main(int argc, char** argv)
{
try {
cout << "Start:" << endl;
/* Coordinate c1(10.531,20.5e-5,30);
Coordinate c2(c1);
Coordinate c3;
cout << c1.equals2D(c2) << endl;
cout << c1.equals2D(c3) << endl;
c3.setCoordinate(c1);
cout << c1.equals2D(c3) << endl;
Coordinate c4(10.531,20.5e-5);
Coordinate c5(10.531,20.5e-5);
cout << c1.equals2D(c4) << endl;
cout << (c1==c4) << endl;
cout << c4.equals2D(c5) << endl;
cout << (c4==c5) << endl;
cout << c1.toString() << endl;;
cout << c4.toString() << endl;;
Coordinate c0(10,20.5e-5,30);
cout << c0.distance(c2) << endl;
*/
/* cout << Dimension::toDimensionSymbol(-2) << endl;
cout << Dimension::toDimensionSymbol(Dimension::DONTCARE) << endl;
cout << Dimension::toDimensionSymbol(87) << endl;
cout << Dimension::toDimensionSymbol(Dimension::DONTCARE) << endl;
*/
/* cout << Dimension::toDimensionValue('T') << endl;
cout << Dimension::toDimensionValue('*') << endl;
cout << Dimension::toDimensionValue('t') << endl;
cout << Dimension::toDimensionValue('Q') << endl;
cout << Dimension::toDimensionValue('*') << endl;
*/
/* Coordinate c1(10,20,30);
Coordinate c2(40,50,60);
Coordinate c3(1,2,3);
Envelope e1;
Envelope e2(6,7,8,9);
Envelope e3(c1,c2);
Envelope e4(c3);
Envelope e5(e2);
e2.setToNull();
*/
/* Coordinate c1(10,20,30);
Coordinate c2(40,50,60);
LineSegment ls1;
ls1.setCoordinates(c1,c2);
*/
/* cout << Location::UNDEF << endl;
cout << Location::toLocationSymbol(Location::UNDEF) << endl;
cout << Location::toLocationSymbol(Location::EXTERIOR) << endl;
cout << Location::toLocationSymbol(99) << endl;
cout << Location::toLocationSymbol(Location::INTERIOR) << endl;
*/
/* Coordinate c1(10,20,30);
PrecisionModel pm;
Point p(c1,pm,10);
*/
/* Coordinate c1(10,20,30);
Coordinate c2(1,2,3);
CoordinateList cl1;
CoordinateList cl2(c1);
cl1.add(c1);
c1.setCoordinate(c2);
*/
/* Point p;
cout << p.getNumPoints() << endl;
cout << p.isEmpty() << endl;
*/
/* Coordinate c2(1,2,3);
PrecisionModel pm;
Point p1(c2,pm,2);
cout << p1.getNumPoints() << endl;
cout << p1.isEmpty() << endl;
CoordinateList cl=p1.getCoordinates();
Point p2(p1);
*/
/* Coordinate c1(10,20,30);
PrecisionModel pm(10,5,1);
cout << pm.toString() << endl;
Coordinate c2=pm.toInternal(c1);
cout << c1.toString() << endl;
cout << c2.toString() << endl;
*/
/* IntersectionMatrix im("TF*012TF*aaa");
cout << im.matches("TF*012TF*") << endl;
cout << im.matches("TF*012TFT") << endl;
// cout << im.matches("TF*012TF*aaa") << endl;
cout << im.toString() << endl;
im.transpose();
cout << im.toString() << endl;
*/
/* LineString ls;
Point p;
cout << ls.isEquivalentClass(&ls) << endl;
cout << ls.isEquivalentClass(&p) << endl;
*/
/* Coordinate c1(0,0);
Coordinate c2(100,0);
Coordinate c3(100,100);
Coordinate c4(0,100);
Coordinate d1(25,25);
Coordinate d2(75,25);
Coordinate d3(75,75);
Coordinate d4(25,75);
CoordinateList outlist;
outlist.add(c1);
outlist.add(c2);
outlist.add(c3);
outlist.add(c4);
outlist.add(c1);
CoordinateList inlist(5);
inlist.add(d1);
inlist.add(d2);
inlist.add(d3);
inlist.add(d4);
inlist.add(d1);
int a=inlist.getSize();
a=outlist.getSize();
CoordinateList testlist(outlist);
a=testlist.getSize();
cout << outlist.toString() <<endl;
cout << testlist.toString() <<endl;
outlist.deleteAt(2);
a=outlist.getSize();
a=testlist.getSize();
cout << outlist.toString() <<endl;
cout << testlist.toString() <<endl;
LinearRing outring(outlist,PrecisionModel(),100);
LinearRing inring(inlist,PrecisionModel(),50);
vector<Geometry *> h(1,&inring);
Polygon p(&outring,&h,PrecisionModel(),10);
a=p.getNumPoints();
LineString ls1(inlist,PrecisionModel(),1);
LineString ls2(outlist,PrecisionModel(),1);
bool z=ls1.equalsExact(&p);
z=ls1.equalsExact(&ls2);
z=ls1.equalsExact(&ls1);
Polygon p1(p);
p.compareToSameClass(&p1);
p.normalize();
*/
// throw ParseException("Test Message","ErrorLoc");
// Geometry g(PrecisionModel(),10);
// GeometryFactory gf;
// string a(typeid(gf).name());
// cout << a << endl;
// WKTReader wr;
// CoordinateList cl=wr.getCoordinates1();
// cout << cl.toString() <<endl;
// GeometryFactory gf;
// Polygon p(gf.createPolygon(NULL,NULL));
// StringTokenizer st("\ntest of,(str");
// StringTokenizer st("123 123aaa aaa 1.7e+30");
// int a=st.nextToken();
// if (a==StringTokenizer::TT_NUMBER)
// cout << "Number: " << st.getNVal() <<endl;
// else if (a==StringTokenizer::TT_WORD)
// cout << "Word: " << st.getSVal() <<endl;
// else
// cout << "Something else" <<endl;
/* WKTReader r(GeometryFactory(PrecisionModel(),10));
Geometry* g=r.read("POLYGON((150 150, 410 150, 280 20, 20 20, 150 150),(170 120, 330 120, 260 50, 100 50, 170 120))");
// Geometry* g=r.read("POLYGON((150 150, 410 150, 280 20, 20 20, 150 150))");
WKTWriter *w=new WKTWriter();
string s=w->write(g);
cout << s << endl;
cout << "End" << endl;
} catch (char *message){
cout << message << endl;
} catch (ParseException pe) {
cout << pe.toString() << endl;
}
return 0;
}
*/
\ No newline at end of file
SUBDIRS = geom \
graph \
io \
util \
test
// CTS.cpp : Testing class
//
#include "io.h"
#include <iostream>
#include <fstream>
using namespace std;
int main(int argc, char** argv)
{
try {
ofstream out("WKTOut");
ifstream in("WKTIn");
string instr;
string outstr;
WKTReader r(GeometryFactory(PrecisionModel(),10));
WKTWriter *w=new WKTWriter();
Geometry *g;
cout << "Start Testing:" << endl;
while(!in.eof()) {
&getline(in,instr);
if (instr!="") {
g=r.read(instr);
outstr=w->write(g);
out << "----------" << endl;
out << instr << endl;
out << outstr << endl;
out << "----------" << endl << endl;
}
}
out.flush();
out.close();
cout << "End of Testing" << endl;
} catch (char *message){
cout << message << endl;
} catch (ParseException pe) {
cout << pe.toString() << endl;
}
return 0;
}
POINT(110 130)
LINESTRING(40 40, 50 130, 130 130)
POLYGON((150 150, 410 150, 280 20, 20 20, 150 150),(170 120, 330 120, 260 50, 100 50, 170 120))
MULTIPOINT(10 80, 110 170, 110 120)
MULTILINESTRING((110 100, 40 30, 180 30),(170 30, 110 90, 50 30))
MULTIPOLYGON(((110 110, 70 200, 150 200, 110 110),(110 110, 100 180, 120 180, 110 110)),((110 110, 150 20, 70 20, 110 110),(110 110, 120 40, 100 40, 110 110)))
GEOMETRYCOLLECTION(POINT(110 260), LINESTRING(110 0, 110 60))
\ No newline at end of file
----------
POINT(110 130)
POINT (110.0000000000000000 130.0000000000000000)
----------
----------
LINESTRING(40 40, 50 130, 130 130)
LINESTRING (40.0000000000000000 40.0000000000000000, 50.0000000000000000 130.0000000000000000, 130.0000000000000000 130.0000000000000000)
----------
----------
POLYGON((150 150, 410 150, 280 20, 20 20, 150 150),(170 120, 330 120, 260 50, 100 50, 170 120))
POLYGON ((150.0000000000000000 150.0000000000000000, 410.0000000000000000 150.0000000000000000, 280.0000000000000000 20.0000000000000000, 20.0000000000000000 20.0000000000000000, 150.0000000000000000 150.0000000000000000), (170.0000000000000000 120.0000000000000000, 330.0000000000000000 120.0000000000000000, 260.0000000000000000 50.0000000000000000, 100.0000000000000000 50.0000000000000000, 170.0000000000000000 120.0000000000000000))
----------
----------
MULTIPOINT(10 80, 110 170, 110 120)
MULTIPOINT (10.0000000000000000 80.0000000000000000, 110.0000000000000000 170.0000000000000000, 110.0000000000000000 120.0000000000000000)
----------
----------
MULTILINESTRING((110 100, 40 30, 180 30),(170 30, 110 90, 50 30))
MULTILINESTRING ((110.0000000000000000 100.0000000000000000, 40.0000000000000000 30.0000000000000000, 180.0000000000000000 30.0000000000000000), (170.0000000000000000 30.0000000000000000, 110.0000000000000000 90.0000000000000000, 50.0000000000000000 30.0000000000000000))
----------
----------
MULTIPOLYGON(((110 110, 70 200, 150 200, 110 110),(110 110, 100 180, 120 180, 110 110)),((110 110, 150 20, 70 20, 110 110),(110 110, 120 40, 100 40, 110 110)))
MULTIPOLYGON (((110.0000000000000000 110.0000000000000000, 70.0000000000000000 200.0000000000000000, 150.0000000000000000 200.0000000000000000, 110.0000000000000000 110.0000000000000000), (110.0000000000000000 110.0000000000000000, 100.0000000000000000 180.0000000000000000, 120.0000000000000000 180.0000000000000000, 110.0000000000000000 110.0000000000000000)), ((110.0000000000000000 110.0000000000000000, 150.0000000000000000 20.0000000000000000, 70.0000000000000000 20.0000000000000000, 110.0000000000000000 110.0000000000000000), (110.0000000000000000 110.0000000000000000, 120.0000000000000000 40.0000000000000000, 100.0000000000000000 40.0000000000000000, 110.0000000000000000 110.0000000000000000)))
----------
----------
GEOMETRYCOLLECTION(POINT(110 260), LINESTRING(110 0, 110 60))
GEOMETRYCOLLECTION (POINT (110.0000000000000000 260.0000000000000000), LINESTRING (110.0000000000000000 0.0000000000000000, 110.0000000000000000 60.0000000000000000))
----------
#include "MarkupSTL.h"
//#include "io.h"
#include <string>
#include <iostream>
#include <fstream>
#include "util.h"
#include "graph.h"
using namespace std;
int main(int argC, char* argV[]) {
string source="d://test.xml";
string precisionModel="";
string desc="";
string geomAin="";
string geomBin="";
string geomAout="";
string geomBout="";
string opName="";
string opSig="";
string opRes="";
int testCount=0;
// PlanarGraph::cga++;
/* try {
Assert::equals(Coordinate(10,10),Coordinate(10,10));
Assert::equals(Coordinate(10,10),Coordinate(20,20));
} catch (AssertionFailedException afe) {
cout << afe.toString() << endl;
}
WKTReader r(GeometryFactory(PrecisionModel(),10));
WKTWriter *w=new WKTWriter();
Geometry *gA;
Geometry *gB;
CMarkupSTL xml;
bool a=xml.Load(source.c_str());
xml.ResetPos();
a=xml.FindElem("run");
a=xml.FindChildElem("precisionModel");
precisionModel=xml.GetChildAttrib("type");
cout << "Precision Model: " << precisionModel << endl;
while (xml.FindChildElem("case")) {
xml.IntoElem();
testCount++;
cout << "Test #" << testCount << endl;
a=xml.FindChildElem("desc");
desc=xml.GetChildData();
cout << "\t" << desc << endl;
a=xml.FindChildElem("a");
geomAin=xml.GetChildData();
gA=r.read(geomAin);
geomAout=w->write(gA);
cout << "\tGeometry A" << endl;
cout << "\t\tIn:" << geomAin << endl;
cout << "\t\tOut:" << geomAout << endl;
a=xml.FindChildElem("b");
geomBin=xml.GetChildData();
gB=r.read(geomBin);
geomBout=w->write(gB);
cout << "\tGeometry B" << endl;
cout << "\t\tIn:" << geomBin << endl;
cout << "\t\tOut:" << geomBout << endl;
a=xml.FindChildElem("test");
xml.IntoElem();
a=xml.FindChildElem("op");
opName=xml.GetChildAttrib("name");
opSig=xml.GetChildAttrib("arg3");
opRes=xml.GetChildData();
cout << "\tOperation '" << opName << "[" << opSig <<"]' should be " << opRes << endl;
xml.OutOfElem();
xml.OutOfElem();
}
*/
}
\ No newline at end of file
noinst_LIBRARIES = libgeom.a
libgeom_a_SOURCES = Coordinate.cpp \
CoordinateList.cpp \
Dimension.cpp \
Envelope.cpp \
Geometry.cpp \
GeometryCollection.cpp \
GeometryCollectionIterator.cpp \
GeometryFactory.cpp \
IntersectionMatrix.cpp \
LinearRing.cpp \
LineSegment.cpp \
LineString.cpp \
Location.cpp \
MultiLineString.cpp \
MultiPoint.cpp \
MultiPolygon.cpp \
Point.cpp \
Polygon.cpp \
PrecisionModel.cpp
INCLUDES += -I../headers
SUBDIRS = index
noinst_LIBRARIES = libgraph.a
libgraph_a_SOURCES = Depth.cpp \
DirectedEdge.cpp \
DirectedEdgeStar.cpp \
Edge.cpp \
EdgeEnd.cpp \
EdgeEndStar.cpp \
EdgeIntersection.cpp \
EdgeIntersectionList.cpp \
EdgeList.cpp \
EdgeRing.cpp \
GeometryGraph.cpp \
GraphComponent.cpp \
Label.cpp \
Node.cpp \
NodeFactory.cpp \
NodeMap.cpp \
PlanarGraph.cpp \
Position.cpp \
Quadrant.cpp \
TopologyLocation.cpp
INCLUDES += -I../headers
noinst_LIBRARIES = libindex.a
libindex_a_SOURCES = MonotoneChain.cpp \
MonotoneChainEdge.cpp \
MonotoneChainIndexer.cpp \
SegmentIntersector.cpp \
SimpleMCSweepLineIntersector.cpp \
SweepLineEvent.cpp \
SweepLineSegment.cpp
INCLUDES += -I../../headers
SUBDIRS = markup
noinst_LIBRARIES = libio.a
libio_a_SOURCES = ParseException.cpp \
StringTokenizer.cpp \
WKTReader.cpp \
WKTWriter.cpp \
Writer.cpp
INCLUDES += -I../headers
noinst_LIBRARIES = libmarkup.a
libmarkup_a_SOURCES = MarkupSTL.cpp
INCLUDES += -I../../headers
<run>
<precisionModel type="FLOATING"/>
<case>
<desc>AC A-shells overlapping B-shell at A-vertex</desc>
<a>
POLYGON(
(100 60, 140 100, 100 140, 60 100, 100 60))
</a>
<b>
MULTIPOLYGON(
(
(80 40, 120 40, 120 80, 80 80, 80 40)),
(
(120 80, 160 80, 160 120, 120 120, 120 80)),
(
(80 120, 120 120, 120 160, 80 160, 80 120)),
(
(40 80, 80 80, 80 120, 40 120, 40 80)))
</b>
<test>
<op name="relate" arg1="A" arg2="B" arg3="21210F212">true</op>
</test>
</case>
</run>
noinst_PROGRAMS = CTS SimpleWKTTester XMLTester
#LIBS += ../geom/libgeom.a
#LIBS += ../graph/libgraph.a
#LIBS += ../graph/index/libindex.a
#LIBS += ../io/libio.a
#LIBS += ../io/markup/libmarkup.a
#LIBS += ../util/libutil.a
CTS_SOURCES = CTS.cpp
CTS_LDADD = $(LIBS)
SimpleWKTTester_SOURCES = SimpleWKTTester.cpp
SimpleWKTTester_LDADD = $(LIBS)
XMLTester_SOURCES = XMLTester.cpp
XMLTester_LDADD = $(LIBS)
INCLUDES += -I../headers
INCLUDES += -I../io/markup
noinst_LIBRARIES = libutil.a
libutil_a_SOURCES = Assert.cpp \
AssertionFailedException.cpp
INCLUDES += -I../headers
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment