예제 #1
0
파일: Targets.cs 프로젝트: mitice/foo
        private Area createTargetArea(Poi target)
        {
            double topLeftLat     = target.getLatitude() + maxLatitudeToTarget;
            double topLeftLon     = target.getLongitude() - maxLongitudeToTarget;
            double bottomRightLat = target.getLatitude() - maxLatitudeToTarget;
            double bottomRightLon = target.getLongitude() + maxLongitudeToTarget;

            return(new Area(topLeftLat, topLeftLon, bottomRightLat, bottomRightLon));
        }
예제 #2
0
파일: PoiXmlAdapter.cs 프로젝트: mitice/foo
        public override string serialize(object obj)
        {
            Poi           p       = (Poi)obj;
            StringBuilder builder = new StringBuilder();

            // opening tag
            builder.Append("<");
            builder.Append(getXmlNodeName());
            builder.Append(">");
            // lang
            builder.Append("<lang>");
            builder.Append(p.getLang());
            builder.Append("</lang>");
            // name
            builder.Append("<name>");
            builder.Append(p.getName());
            builder.Append("</name>");
            // latitude
            builder.Append("<latitude>");
            builder.Append(p.getLatitude());
            builder.Append("</latitude>");
            // longitude
            builder.Append("<longitude>");
            builder.Append(p.getLongitude());
            builder.Append("</longitude>");
            // type
            builder.Append("<type>");
            builder.Append(p.getType());
            builder.Append("</type>");
            // description
            builder.Append("<descr><![CDATA[");
            builder.Append(p.getDescr());
            builder.Append("]]></descr>");
            // media files
            MediaFilesXmlAdapter mfxa = new MediaFilesXmlAdapter(p.getMediaFiles());
            string mediaFilesXml      = mfxa.serialize();

            builder.Append(mediaFilesXml);
            // main details
            MainDetailsXmlAdapter mdxa = new MainDetailsXmlAdapter(p.getMainDetails());
            string mainDetailsXml      = mdxa.serialize();

            builder.Append(mainDetailsXml);
            // closing tag
            builder.Append("</");
            builder.Append(getXmlNodeName());
            builder.Append(">");
            return(builder.ToString());
        }
예제 #3
0
        /**
         * Returns poi sub dir by poi and named area
         */
        private string getPoiSubDir(Poi p, NamedArea namedArea)
        {
            string dirName = p.getName() + "_" + p.getLatitude() + "_" + p.getLongitude();

            return(getPoiSubDir(dirName, namedArea));
        }