Index: /applications/editors/josm/plugins/indoor_sweepline/LICENSE
===================================================================
--- /applications/editors/josm/plugins/indoor_sweepline/LICENSE	(revision 32103)
+++ /applications/editors/josm/plugins/indoor_sweepline/LICENSE	(revision 32103)
@@ -0,0 +1,345 @@
+		    GNU GENERAL PUBLIC LICENSE
+		       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+	51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+
+		    GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+			    NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+
+
+	    How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year  name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Library General
+Public License instead of this License.
Index: /applications/editors/josm/plugins/indoor_sweepline/build.xml
===================================================================
--- /applications/editors/josm/plugins/indoor_sweepline/build.xml	(revision 32103)
+++ /applications/editors/josm/plugins/indoor_sweepline/build.xml	(revision 32103)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<project name="indoor_sweepline" default="dist" basedir=".">
+
+    <!-- enter the SVN commit message -->
+    <property name="commit.message" value="Commit message"/>
+    <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
+    <property name="plugin.main.version" value="7817"/>
+
+    <property name="plugin.author" value="Roland M. Olbricht"/>
+    <property name="plugin.class" value="indoor_sweepline.IndoorSweepline"/>
+    <property name="plugin.description" value="This plugin simplifies the mapping and editing of indoor corridors."/>
+    <!-- <property name="plugin.icon" value=""/> -->
+    <property name="plugin.link" value="https://wiki.openstreetmap.org/wiki/JOSM/Plugins/indoor_sweepline"/>
+
+    <!-- ** include targets that all plugins have in common ** -->
+    <import file="../build-common.xml"/>
+</project>
Index: /applications/editors/josm/plugins/indoor_sweepline/build/LICENSE
===================================================================
--- /applications/editors/josm/plugins/indoor_sweepline/build/LICENSE	(revision 32103)
+++ /applications/editors/josm/plugins/indoor_sweepline/build/LICENSE	(revision 32103)
@@ -0,0 +1,345 @@
+		    GNU GENERAL PUBLIC LICENSE
+		       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+	51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+
+		    GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+			    NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+
+
+	    How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year  name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Library General
+Public License instead of this License.
Index: /applications/editors/josm/plugins/indoor_sweepline/src/indoor_sweepline/Beam.java
===================================================================
--- /applications/editors/josm/plugins/indoor_sweepline/src/indoor_sweepline/Beam.java	(revision 32103)
+++ /applications/editors/josm/plugins/indoor_sweepline/src/indoor_sweepline/Beam.java	(revision 32103)
@@ -0,0 +1,318 @@
+package indoor_sweepline;
+
+import java.util.Vector;
+
+
+public class Beam
+{
+    public Beam(double width, CorridorPart.ReachableSide defaultSide)
+    {
+	parts = new Vector<CorridorPart>();
+	
+	setDefaultSide_(defaultSide);	
+	addCorridorPart_(true, width);
+	adjustStripCache();
+    }
+    
+    
+    private void setDefaultSide_(CorridorPart.ReachableSide defaultSide)
+    {
+	this.defaultSide = defaultSide;
+	defaultType = defaultSide == CorridorPart.ReachableSide.RIGHT ?
+	    CorridorPart.Type.WALL : CorridorPart.Type.PASSAGE;
+    }
+    
+    public void setDefaultSide(CorridorPart.ReachableSide defaultSide)
+    {
+	setDefaultSide_(defaultSide);
+	adjustStripCache();
+    }
+    
+    
+    public Vector<CorridorPart> getBeamParts()
+    {
+	return parts;
+    }
+
+    
+    private void addCorridorPart_(boolean append, double width)
+    {
+	CorridorPart.ReachableSide side = defaultSide == CorridorPart.ReachableSide.RIGHT ?
+	    defaultSide : CorridorPart.ReachableSide.ALL;
+	    
+	if (append)
+	    parts.add(new CorridorPart(width, defaultType, side));
+	else
+	    parts.add(0, new CorridorPart(width, defaultType, side));
+    }
+
+    public void addCorridorPart(boolean append, double width)
+    {
+	addCorridorPart_(append, width);
+	adjustStripCache();
+    }
+
+    
+    public void setCorridorPartWidth(int partIndex, double value)
+    {
+	parts.elementAt(partIndex).width = value;
+	adjustStripCache();
+    }
+
+    
+    public void setCorridorPartType(int partIndex, CorridorPart.Type type)
+    {
+	parts.elementAt(partIndex).setType(type, defaultSide);
+	enforceSideCoherence();
+	adjustStripCache();
+    }
+
+    
+    public void setCorridorPartSide(int partIndex, CorridorPart.ReachableSide side)
+    {
+	parts.elementAt(partIndex).setSide(side, defaultSide);
+	enforceSideCoherence();    
+	adjustStripCache();
+    }
+    
+    
+    private void enforceSideCoherence()
+    {
+	for (int i = 1; i < parts.size(); ++i)
+	{
+	    if (parts.elementAt(i).getSide() != CorridorPart.ReachableSide.ALL
+		    && parts.elementAt(i-1).getSide() != CorridorPart.ReachableSide.ALL)
+		parts.elementAt(i).setSide(parts.elementAt(i-1).getSide(), defaultSide);
+	}
+    }
+    
+    
+    private boolean isVoidAbove(int i)
+    {
+	return i == 0 || parts.elementAt(i-1).getType() == CorridorPart.Type.VOID
+	    || (parts.elementAt(i-1).getSide() == CorridorPart.ReachableSide.RIGHT
+		&& defaultSide == CorridorPart.ReachableSide.LEFT)
+	    || (parts.elementAt(i-1).getSide() == CorridorPart.ReachableSide.LEFT
+		&& defaultSide == CorridorPart.ReachableSide.RIGHT);
+    }
+    
+    private boolean isVoidBelow(int i)
+    {
+	return i == parts.size() || parts.elementAt(i).getType() == CorridorPart.Type.VOID
+	    || (parts.elementAt(i).getSide() == CorridorPart.ReachableSide.RIGHT
+		&& defaultSide == CorridorPart.ReachableSide.LEFT)
+	    || (parts.elementAt(i).getSide() == CorridorPart.ReachableSide.LEFT
+		&& defaultSide == CorridorPart.ReachableSide.RIGHT);
+    }
+    
+    private boolean isPassageAbove(int i)
+    {
+	return i > 0
+	    && parts.elementAt(i-1).getType() == CorridorPart.Type.PASSAGE
+	    && defaultSide == CorridorPart.ReachableSide.ALL;
+    }
+    
+    private boolean isPassageBelow(int i)
+    {
+	return i < parts.size()
+	    && parts.elementAt(i).getType() == CorridorPart.Type.PASSAGE
+	    && defaultSide == CorridorPart.ReachableSide.ALL;
+    }
+    
+    private boolean isReachableLeft(int i)
+    {
+	if (defaultSide == CorridorPart.ReachableSide.RIGHT)
+	    return false;
+	if (parts.elementAt(i).getSide() == CorridorPart.ReachableSide.LEFT)
+	    return true;
+	return defaultSide == CorridorPart.ReachableSide.LEFT;
+    }
+    
+    
+    private void connectTwoPos(StripPosition newPos, boolean toLeft)
+    {
+	StripPosition other = null;
+	if (rhsStrips.size() > 0 && rhsStrips.elementAt(rhsStrips.size()-1).connectedTo == -1)
+	{
+	    newPos.connectedToSameSide = !toLeft;
+	    newPos.connectedTo = rhsStrips.size()-1;
+	    other = rhsStrips.elementAt(rhsStrips.size()-1);
+	}
+	else
+	{
+	    newPos.connectedToSameSide = toLeft;
+	    newPos.connectedTo = lhsStrips.size()-1;
+	    other = lhsStrips.elementAt(lhsStrips.size()-1);
+	}
+	    
+	other.connectedToSameSide = newPos.connectedToSameSide;
+	if (toLeft)
+	{
+	    other.connectedTo = lhsStrips.size();
+	    lhsStrips.add(newPos);
+	}
+	else
+	{
+	    other.connectedTo = rhsStrips.size();			
+	    rhsStrips.add(newPos);
+	}
+    }
+    
+    
+    private class StripPosition
+    {
+	StripPosition(int nodeIndex, double offset)
+	{
+	    this.nodeIndex = nodeIndex;
+	    this.offset = offset;
+	    connectedTo = -1;
+	    connectedToSameSide = false;
+	}
+    
+	public int nodeIndex;
+	public double offset;
+	public int connectedTo;
+	public boolean connectedToSameSide;
+    }
+    
+    
+    private Vector<CorridorPart> parts;
+    private Vector<StripPosition> lhsStrips;
+    private Vector<StripPosition> rhsStrips;
+
+    
+    private void adjustStripCache()
+    {
+	lhsStrips = new Vector<StripPosition>();
+	rhsStrips = new Vector<StripPosition>();
+	
+	double offset = 0;
+	
+	for (int i = 0; i <= parts.size(); ++i)
+	{
+	    if (isVoidBelow(i))
+	    {
+		if (isPassageAbove(i))
+		{
+		    StripPosition lhs = new StripPosition(i, offset);
+		    StripPosition rhs = new StripPosition(i, offset);
+		    
+		    lhs.connectedToSameSide = false;
+		    lhs.connectedTo = rhsStrips.size();
+		    rhs.connectedToSameSide = false;
+		    rhs.connectedTo = lhsStrips.size();
+		    
+		    lhsStrips.add(lhs);
+		    rhsStrips.add(rhs);
+		}
+		else if (!isVoidAbove(i))
+		    connectTwoPos(new StripPosition(i, offset), isReachableLeft(i-1));
+	    }
+	    else if (isPassageBelow(i))
+	    {
+		if (isVoidAbove(i))
+		{
+		    StripPosition lhs = new StripPosition(i, offset);
+		    StripPosition rhs = new StripPosition(i, offset);
+		    
+		    lhs.connectedToSameSide = false;
+		    lhs.connectedTo = rhsStrips.size();
+		    rhs.connectedToSameSide = false;
+		    rhs.connectedTo = lhsStrips.size();
+		    
+		    lhsStrips.add(lhs);
+		    rhsStrips.add(rhs);
+		}
+		else if (!isPassageAbove(i))
+		    connectTwoPos(new StripPosition(i, offset), !isReachableLeft(i-1));
+	    }
+	    else
+	    {
+		if (isVoidAbove(i))
+		{
+		    if (isReachableLeft(i))
+			lhsStrips.add(new StripPosition(i, offset));
+		    else
+			rhsStrips.add(new StripPosition(i, offset));
+		}
+		else if (isPassageAbove(i))
+		{
+		    if (isReachableLeft(i))
+			rhsStrips.add(new StripPosition(i, offset));
+		    else
+			lhsStrips.add(new StripPosition(i, offset));
+		}
+	    }
+	    
+	    if (i < parts.size())
+		offset += parts.elementAt(i).width;
+	}
+    }
+    
+    
+    public Vector<Double> leftHandSideStrips()
+    {
+	Vector<Double> offsets = new Vector<Double>();
+	for (StripPosition pos : lhsStrips)
+	    offsets.add(pos.offset);
+	    
+	return offsets;
+    }
+    
+    
+    public Vector<Double> rightHandSideStrips()
+    {
+	Vector<Double> offsets = new Vector<Double>();
+	for (StripPosition pos : rhsStrips)
+	    offsets.add(pos.offset);
+	    
+	return offsets;
+    }
+    
+    
+    public int getBeamPartIndex(boolean toTheLeft, int i)
+    {
+	if (toTheLeft)
+	    return lhsStrips.elementAt(i).nodeIndex;
+	else
+	    return rhsStrips.elementAt(i).nodeIndex;
+    }
+    
+
+    public boolean appendNodes(IndoorSweeplineModel.SweepPolygonCursor cursor, boolean fromRight,
+	BeamGeography geography, String level)
+    {
+	if (fromRight)
+	{
+	    StripPosition pos = rhsStrips.elementAt(cursor.partIndex);
+	    StripPosition to = pos.connectedToSameSide ?
+		rhsStrips.elementAt(pos.connectedTo) : lhsStrips.elementAt(pos.connectedTo);
+		
+	    geography.appendNodes(pos.nodeIndex, to.nodeIndex, level);
+	    
+	    if (!pos.connectedToSameSide)
+		--cursor.stripIndex;
+	    cursor.partIndex = pos.connectedTo;
+	    
+	    return !pos.connectedToSameSide;
+	}
+	else
+	{
+	    StripPosition pos = lhsStrips.elementAt(cursor.partIndex);
+	    StripPosition to = pos.connectedToSameSide ?
+		lhsStrips.elementAt(pos.connectedTo) : rhsStrips.elementAt(pos.connectedTo);
+		
+	    geography.appendNodes(pos.nodeIndex, to.nodeIndex, level);
+	    
+	    if (!pos.connectedToSameSide)
+		++cursor.stripIndex;
+	    cursor.partIndex = pos.connectedTo;
+	    
+	    return pos.connectedToSameSide;
+	}
+    }
+    
+    
+    private CorridorPart.Type defaultType;
+    private CorridorPart.ReachableSide defaultSide;
+}
Index: /applications/editors/josm/plugins/indoor_sweepline/src/indoor_sweepline/BeamGeography.java
===================================================================
--- /applications/editors/josm/plugins/indoor_sweepline/src/indoor_sweepline/BeamGeography.java	(revision 32103)
+++ /applications/editors/josm/plugins/indoor_sweepline/src/indoor_sweepline/BeamGeography.java	(revision 32103)
@@ -0,0 +1,111 @@
+package indoor_sweepline;
+
+import java.util.List;
+import java.util.Vector;
+import org.openstreetmap.josm.data.coor.LatLon;
+import org.openstreetmap.josm.data.osm.DataSet;
+import org.openstreetmap.josm.data.osm.Node;
+
+
+public class BeamGeography
+{
+    public BeamGeography(DataSet dataSet, ModelGeography target)
+    {
+	partsGeography = new Vector<CorridorGeography>();
+	nodes = new Vector<Node>();
+	this.dataSet = dataSet;
+	this.target = target;
+    }
+
+    
+    public void appendNodes(int from, int to, String level)
+    {
+	if (from <= to)
+	{
+	    for (int i = from; i < to; ++i)
+	    {
+		target.appendNode(nodes.elementAt(i));
+		CorridorPart part = parts.elementAt(i);
+		partsGeography.elementAt(i).appendNodes(part.getType(), part.getSide(), level,
+		    nodes.elementAt(i).getCoor(), nodes.elementAt(i+1).getCoor(), target);
+	    }
+	    target.appendNode(nodes.elementAt(to));
+	}
+	else
+	{
+	    for (int i = from; i > to; --i)
+	    {
+		target.appendNode(nodes.elementAt(i));
+		CorridorPart part = parts.elementAt(i-1);
+		partsGeography.elementAt(i-1).appendNodes(part.getType(), part.getSide(), level,
+		    nodes.elementAt(i).getCoor(), nodes.elementAt(i-1).getCoor(), target);
+	    }
+	    target.appendNode(nodes.elementAt(to));
+	}
+    }
+
+    
+    public void adjustNodes(LatLon pivot, Vector<CorridorPart> parts)
+    {
+	this.parts = parts;
+	adjustNode(0, new LatLon(pivot.lat(), pivot.lon()));
+    
+	double offset = 0;
+	for (int i = 0; i < parts.size(); ++i)
+	{
+	    adjustPartGeography(i);
+	    offset += parts.elementAt(i).width;
+	    adjustNode(i+1, new LatLon(addMetersToLat(pivot, offset), pivot.lon()));
+	}
+	
+	// Size reduction not implemented
+    }
+    
+    
+    private void adjustNode(int i, LatLon coor)
+    {
+	if (nodes.size() <= i)
+	    nodes.setSize(i+1);
+	Node node = nodes.elementAt(i);
+	if (node == null)
+	{
+	    node = new Node(coor);
+	    dataSet.addPrimitive(node);
+	    nodes.setElementAt(node, i);
+	}
+	else
+	    node.setCoor(coor);
+    }
+    
+    
+    private void adjustPartGeography(int i)
+    {
+	if (partsGeography.size() <= i)
+	    partsGeography.setSize(i+1);
+	CorridorGeography partGeography = partsGeography.elementAt(i);
+	if (partGeography == null)
+	{
+	    partGeography = new CorridorGeography(dataSet);
+	    partsGeography.setElementAt(partGeography, i);
+	}
+    }
+    
+    
+    public LatLon coorAt(int i)
+    {
+	return nodes.elementAt(i).getCoor();
+    }
+    
+    
+    private Vector<CorridorPart> parts;
+    private Vector<CorridorGeography> partsGeography;
+    private ModelGeography target;
+    private DataSet dataSet;
+    private Vector<Node> nodes;
+
+    
+    private static double addMetersToLat(LatLon latLon, double south)
+    {
+	return latLon.lat() - south *(360./4e7);
+    }
+}
Index: /applications/editors/josm/plugins/indoor_sweepline/src/indoor_sweepline/CorridorGeography.java
===================================================================
--- /applications/editors/josm/plugins/indoor_sweepline/src/indoor_sweepline/CorridorGeography.java	(revision 32103)
+++ /applications/editors/josm/plugins/indoor_sweepline/src/indoor_sweepline/CorridorGeography.java	(revision 32103)
@@ -0,0 +1,166 @@
+package indoor_sweepline;
+
+import java.util.List;
+import java.util.Vector;
+import org.openstreetmap.josm.data.coor.LatLon;
+import org.openstreetmap.josm.data.osm.DataSet;
+import org.openstreetmap.josm.data.osm.Node;
+import org.openstreetmap.josm.data.osm.Way;
+
+
+public class CorridorGeography
+{
+    public CorridorGeography(DataSet dataSet)
+    {
+	this.dataSet = dataSet;
+    }
+    
+    
+    private void setExtraElements(CorridorPart.ReachableSide side, LatLon from, LatLon to, boolean extraWayUp)
+    {
+	LatLon middleCoor = new LatLon((from.lat() + to.lat())/2.,
+	    (from.lon() + to.lon())/2.);
+	if (middleNode == null)
+	{
+	    middleNode = new Node(middleCoor);
+	    dataSet.addPrimitive(middleNode);
+	}
+	else
+	    middleNode.setCoor(middleCoor);
+	    
+	LatLon start = from;
+	if (side == CorridorPart.ReachableSide.LEFT)
+	{
+	    if (middleCoor.lat() < start.lat())
+		start = to;
+	}
+	else if (side == CorridorPart.ReachableSide.RIGHT)
+	{
+	    if (start.lat() < middleCoor.lat())
+		start = to;
+	}
+	else if (side == CorridorPart.ReachableSide.FRONT)
+	{
+	    if (start.lon() < middleCoor.lon())
+		start = to;
+	}
+	else if (side == CorridorPart.ReachableSide.BACK)
+	{
+	    if (middleCoor.lon() < start.lon())
+		start = to;
+	}
+	    
+	double scale = Math.cos(middleCoor.lat() * (Math.PI/180.));
+	LatLon detachedCoor = new LatLon(middleCoor.lat() + (start.lon() - middleCoor.lon()) * scale,
+	    middleCoor.lon() - (start.lat() - middleCoor.lat()) / scale);
+	if (detachedNode == null)
+	{
+	    detachedNode = new Node(detachedCoor);
+	    dataSet.addPrimitive(detachedNode);
+	}
+	else
+	    detachedNode.setCoor(detachedCoor);
+	
+	Vector<Node> extraWayNodes = new Vector<Node>();
+	if (extraWayUp)
+	{
+	    extraWayNodes.add(middleNode);
+	    extraWayNodes.add(detachedNode);
+	}
+	else
+	{
+	    extraWayNodes.add(detachedNode);
+	    extraWayNodes.add(middleNode);
+	}
+	if (extraWay == null)
+	{
+	    extraWay = new Way();
+	    extraWay.setNodes(extraWayNodes);
+	    dataSet.addPrimitive(extraWay);
+	}
+	else
+	    extraWay.setNodes(extraWayNodes);
+    }
+    
+    
+    public void appendNodes(CorridorPart.Type type, CorridorPart.ReachableSide side, String level,
+	LatLon from, LatLon to, ModelGeography target)
+    {
+	if (type == CorridorPart.Type.STAIRS_UP || type == CorridorPart.Type.STAIRS_DOWN)
+	{
+	    setExtraElements(side, from, to, type == CorridorPart.Type.STAIRS_UP);
+	    target.appendNode(middleNode);
+
+	    detachedNode.removeAll();
+
+	    extraWay.removeAll();
+	    extraWay.put("highway", "steps");
+	    extraWay.put("incline", "up");
+	    extraWay.put("level", level);
+	}
+	else if (type == CorridorPart.Type.ESCALATOR_UP_LEAVING
+	    || type == CorridorPart.Type.ESCALATOR_UP_ARRIVING
+	    || type == CorridorPart.Type.ESCALATOR_UP_BIDIRECTIONAL
+	    || type == CorridorPart.Type.ESCALATOR_DOWN_LEAVING
+	    || type == CorridorPart.Type.ESCALATOR_DOWN_ARRIVING
+	    || type == CorridorPart.Type.ESCALATOR_DOWN_BIDIRECTIONAL)
+	{
+	    setExtraElements(side, from, to,
+		type == CorridorPart.Type.ESCALATOR_UP_LEAVING
+		|| type == CorridorPart.Type.ESCALATOR_UP_ARRIVING
+		|| type == CorridorPart.Type.ESCALATOR_UP_BIDIRECTIONAL);
+	    target.appendNode(middleNode);
+
+	    detachedNode.removeAll();
+
+	    extraWay.removeAll();
+	    extraWay.put("highway", "steps");
+	    extraWay.put("incline", "up");
+	    if (type == CorridorPart.Type.ESCALATOR_UP_LEAVING
+		    || type == CorridorPart.Type.ESCALATOR_DOWN_ARRIVING)
+		extraWay.put("conveying", "forward");
+	    else if (type == CorridorPart.Type.ESCALATOR_UP_ARRIVING
+		    || type == CorridorPart.Type.ESCALATOR_DOWN_LEAVING)
+		extraWay.put("conveying", "backward");
+	    else
+		extraWay.put("conveying", "reversible");
+	    extraWay.put("level", level);
+	}
+	else if (type == CorridorPart.Type.ELEVATOR)
+	{
+	    setExtraElements(side, from, to, true);
+	    target.appendNode(middleNode);
+
+	    detachedNode.removeAll();
+	    detachedNode.put("highway", "elevator");
+	    
+	    extraWay.removeAll();
+	    extraWay.put("highway", "footway");
+	    extraWay.put("level", level);
+	}
+	else
+	{
+	    if (extraWay != null)
+	    {
+		extraWay.setDeleted(true);
+		extraWay = null;
+	    }
+	    if (middleNode != null)
+	    {
+		middleNode.setDeleted(true);
+		middleNode = null;
+	    }
+	    if (detachedNode != null)
+	    {
+		detachedNode.setDeleted(true);
+		detachedNode = null;
+	    }
+	}
+    }
+    
+    
+    private DataSet dataSet;
+    private Node middleNode;
+    private Node detachedNode;
+    private Way extraWay;
+}
Index: /applications/editors/josm/plugins/indoor_sweepline/src/indoor_sweepline/CorridorPart.java
===================================================================
--- /applications/editors/josm/plugins/indoor_sweepline/src/indoor_sweepline/CorridorPart.java	(revision 32103)
+++ /applications/editors/josm/plugins/indoor_sweepline/src/indoor_sweepline/CorridorPart.java	(revision 32103)
@@ -0,0 +1,95 @@
+package indoor_sweepline;
+
+import java.util.List;
+import java.util.Vector;
+
+
+public class CorridorPart
+{
+    public enum Type
+    {
+	VOID,
+	PASSAGE,
+	WALL,
+	STAIRS_UP,
+	STAIRS_DOWN,
+	ESCALATOR_UP_LEAVING,
+	ESCALATOR_UP_ARRIVING,
+	ESCALATOR_UP_BIDIRECTIONAL,
+	ESCALATOR_DOWN_LEAVING,
+	ESCALATOR_DOWN_ARRIVING,
+	ESCALATOR_DOWN_BIDIRECTIONAL,
+	ELEVATOR
+    }
+    
+
+    public enum ReachableSide
+    {
+	ALL,
+	FRONT,
+	BACK,
+	LEFT,
+	RIGHT
+    }
+    
+
+    public CorridorPart(double width, Type type, ReachableSide side)
+    {
+	this.width = width;
+	this.type = type;
+	this.side = side;
+    }
+    
+    
+    public boolean isObstacle(ReachableSide beamSide)
+    {
+	if (type == Type.VOID)
+	    return false;
+	if (type == Type.PASSAGE)
+	    return (beamSide != ReachableSide.ALL);
+	return true;
+    }
+    
+    
+    public Type getType()
+    {
+	return type;
+    }
+    
+    public void setType(Type type, ReachableSide beamSide)
+    {
+	this.type = type;
+	adjustSideType(beamSide);
+    }
+    
+    
+    public ReachableSide getSide()
+    {
+	return side;
+    }
+    
+    public void setSide(ReachableSide side, ReachableSide beamSide)
+    {
+	this.side = side;
+	adjustSideType(beamSide);
+    }
+    
+
+    public double width;
+    private Type type;
+    private ReachableSide side;
+    
+    
+    private void adjustSideType(ReachableSide beamSide)
+    {
+	if (type == Type.PASSAGE || type == Type.VOID)
+	    side = ReachableSide.ALL;
+	else if (side == ReachableSide.ALL)
+	{
+	    if (beamSide == ReachableSide.RIGHT)
+		side = ReachableSide.RIGHT;
+	    else
+		side = ReachableSide.LEFT;
+	}
+    }
+}
Index: /applications/editors/josm/plugins/indoor_sweepline/src/indoor_sweepline/IndoorSweepline.java
===================================================================
--- /applications/editors/josm/plugins/indoor_sweepline/src/indoor_sweepline/IndoorSweepline.java	(revision 32103)
+++ /applications/editors/josm/plugins/indoor_sweepline/src/indoor_sweepline/IndoorSweepline.java	(revision 32103)
@@ -0,0 +1,29 @@
+package indoor_sweepline;
+
+import javax.swing.JMenu;
+import javax.swing.JMenuItem;
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.gui.MainMenu;
+import org.openstreetmap.josm.plugins.Plugin;
+import org.openstreetmap.josm.plugins.PluginInformation;
+
+public class IndoorSweepline extends Plugin
+{
+    /**
+      * Will be invoked by JOSM to bootstrap the plugin
+      *
+      * @param info  information about the plugin and its local installation    
+      */
+    public IndoorSweepline(PluginInformation info)
+    {
+	super(info);
+	refreshMenu();
+    }
+
+    public static void refreshMenu()
+    {
+        JMenu menu = Main.main.menu.moreToolsMenu;
+        menu.addSeparator();
+        menu.add(new JMenuItem(new IndoorSweeplineWizardAction()));
+    }
+}
Index: /applications/editors/josm/plugins/indoor_sweepline/src/indoor_sweepline/IndoorSweeplineController.java
===================================================================
--- /applications/editors/josm/plugins/indoor_sweepline/src/indoor_sweepline/IndoorSweeplineController.java	(revision 32103)
+++ /applications/editors/josm/plugins/indoor_sweepline/src/indoor_sweepline/IndoorSweeplineController.java	(revision 32103)
@@ -0,0 +1,128 @@
+package indoor_sweepline;
+
+import java.util.List;
+import javax.swing.DefaultComboBoxModel;
+import org.openstreetmap.josm.data.coor.LatLon;
+import org.openstreetmap.josm.gui.layer.Layer;
+import org.openstreetmap.josm.gui.layer.OsmDataLayer;
+import org.openstreetmap.josm.gui.MapView;
+
+
+public class IndoorSweeplineController implements MapView.LayerChangeListener
+{
+    public IndoorSweeplineController(OsmDataLayer activeLayer, LatLon center)
+    {
+	MapView.addLayerChangeListener(this);
+	layer = activeLayer;
+	model = new IndoorSweeplineModel(activeLayer, center);
+	dialog = new IndoorSweeplineWizardDialog(this);
+	dialog.setVisible(true);
+    }
+
+
+    public IndoorSweeplineWizardDialog view()
+    {
+	return dialog;
+    }
+
+    
+    @Override
+    public void activeLayerChange(Layer oldLayer, Layer newLayer)
+    {
+    }
+
+    @Override
+    public void layerAdded(Layer newLayer)
+    {
+    }
+
+    @Override
+    public void layerRemoved(Layer oldLayer)
+    {
+	if (oldLayer == layer)
+	    dialog.setVisible(false);
+    }
+    
+    
+    public int leftRightCount()
+    {
+	return model.leftRightCount();
+    }
+    
+    public void addRightStructure()
+    {
+	if (model.leftRightCount() % 2 == 0)
+	    model.addBeam();
+	else
+	    model.addStrip();
+    }
+    
+    public DefaultComboBoxModel<String> structures()
+    {
+	return model.structures();
+    }
+    
+    public double getStripWidth(int index)
+    {
+	return model.getStripWidth(index);
+    }
+    
+    public void setStripWidth(int index, double value)
+    {
+	model.setStripWidth(index, value);
+    }
+    
+    public List<CorridorPart> getBeamParts(int index)
+    {
+	return model.getBeamParts(index);
+    }
+    
+    public void addCorridorPart(int beamIndex, boolean append, double value)
+    {
+	model.addCorridorPart(beamIndex, append, value);
+    }
+    
+    public void setCorridorPartWidth(int beamIndex, int partIndex, double value)
+    {
+	model.setCorridorPartWidth(beamIndex, partIndex, value);
+    }
+    
+    public void setCorridorPartType(int beamIndex, int partIndex, CorridorPart.Type type)
+    {
+	model.setCorridorPartType(beamIndex, partIndex, type);
+    }
+    
+    public void setCorridorPartSide(int beamIndex, int partIndex, CorridorPart.ReachableSide side)
+    {
+	model.setCorridorPartSide(beamIndex, partIndex, side);
+    }
+    
+    public Strip getStrip(int beamIndex)
+    {
+	return model.getStrip(beamIndex);
+    }
+        
+    public IndoorSweeplineModel.Type getType()
+    {
+	return model.getType();
+    }
+    
+    public void setType(IndoorSweeplineModel.Type type)
+    {
+	model.setType(type);
+    }
+    
+    public String getLevel()
+    {
+	return model.getLevel();
+    }
+    
+    public void setLevel(String level)
+    {
+	model.setLevel(level);
+    }
+    
+    private OsmDataLayer layer;
+    private IndoorSweeplineModel model;
+    private IndoorSweeplineWizardDialog dialog;
+}
Index: /applications/editors/josm/plugins/indoor_sweepline/src/indoor_sweepline/IndoorSweeplineModel.java
===================================================================
--- /applications/editors/josm/plugins/indoor_sweepline/src/indoor_sweepline/IndoorSweeplineModel.java	(revision 32103)
+++ /applications/editors/josm/plugins/indoor_sweepline/src/indoor_sweepline/IndoorSweeplineModel.java	(revision 32103)
@@ -0,0 +1,326 @@
+package indoor_sweepline;
+
+import java.util.List;
+import java.util.Vector;
+import javax.swing.DefaultComboBoxModel;
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.data.coor.LatLon;
+import org.openstreetmap.josm.data.osm.DataSet;
+import org.openstreetmap.josm.gui.layer.OsmDataLayer;
+
+
+public class IndoorSweeplineModel
+{
+    public enum Type
+    {
+	CORRIDOR,
+	PLATFORM
+    };
+
+
+    public IndoorSweeplineModel(OsmDataLayer activeLayer, LatLon center)
+    {
+	target = new ModelGeography(activeLayer.data, center);
+	
+	beams = new Vector<Beam>();
+	strips = new Vector<Strip>();
+	type = Type.CORRIDOR;
+	level = "-1";
+	addBeam();
+	addStrip();
+	addBeam();
+	
+	structureBox = new DefaultComboBoxModel<String>();
+    }
+    
+    
+    private ModelGeography target;
+    
+    
+    public void addBeam()
+    {
+	CorridorPart.ReachableSide side = CorridorPart.ReachableSide.LEFT;
+	if (beams.size() == 0)
+	    side = CorridorPart.ReachableSide.RIGHT;
+	    
+	double width = 10.;
+	if (beams.size() > 0)
+	{
+	    width = 0;
+	    for (CorridorPart part : beams.elementAt(beams.size() - 1).getBeamParts())
+		width += part.width;
+	}
+    
+	double offset = 0;
+	for (int i = 0; i < strips.size(); ++i)
+	    offset += strips.elementAt(i).width;
+	    
+	beams.add(new Beam(width, side));
+	
+	if (strips.size() > 0)
+	    strips.elementAt(beams.size()-2).rhs = beams.elementAt(beams.size()-1).leftHandSideStrips();
+	    
+	updateOsmModel();
+    }
+    
+    
+    public void addStrip()
+    {
+	strips.add(new Strip(target.getDataSet()));
+	if (beams.size() > 1)
+	{
+	    beams.elementAt(beams.size()-1).setDefaultSide(CorridorPart.ReachableSide.ALL);
+	    strips.elementAt(strips.size()-2).rhs = beams.elementAt(strips.size()-1).leftHandSideStrips();
+	}
+	strips.elementAt(strips.size()-1).lhs = beams.elementAt(strips.size()-1).rightHandSideStrips();	    
+	
+	updateOsmModel();
+    }
+
+    
+    public int leftRightCount()
+    {
+	return beams.size() + strips.size();
+    }
+    
+    
+    public DefaultComboBoxModel<String> structures()
+    {
+	structureBox.removeAllElements();
+	double offset = 0;
+	for (int i = 0; i < strips.size(); ++i)
+	{
+	    if (i < beams.size())
+		structureBox.addElement(Double.toString(offset));
+	    structureBox.addElement(Double.toString(offset) + " - "
+		+ Double.toString(offset + strips.elementAt(i).width));
+	    offset += strips.elementAt(i).width;
+	}
+	if (strips.size() < beams.size())
+	    structureBox.addElement(Double.toString(offset));
+	
+	return structureBox;
+    }
+    
+    
+    public Strip getStrip(int index)
+    {
+	return strips.elementAt(index / 2);
+    }
+    
+    
+    public double getStripWidth(int index)
+    {
+	return strips.elementAt(index / 2).width;
+    }
+    
+    
+    public void setStripWidth(int index, double value)
+    {
+	strips.elementAt(index / 2).width = value;
+	
+	updateOsmModel();
+    }
+    
+    
+    public List<CorridorPart> getBeamParts(int index)
+    {
+	return beams.elementAt(index / 2).getBeamParts();
+    }
+
+    
+    public void addCorridorPart(int beamIndex, boolean append, double value)
+    {
+	beams.elementAt(beamIndex / 2).addCorridorPart(append, value);
+	if (beamIndex / 2 > 0)
+	    strips.elementAt(beamIndex / 2 - 1).rhs = beams.elementAt(beamIndex / 2).leftHandSideStrips();
+	if (beamIndex / 2 < strips.size())
+	    strips.elementAt(beamIndex / 2).lhs = beams.elementAt(beamIndex / 2).rightHandSideStrips();
+	    
+	updateOsmModel();
+    }
+
+    
+    public void setCorridorPartWidth(int beamIndex, int partIndex, double value)
+    {
+	beams.elementAt(beamIndex / 2).setCorridorPartWidth(partIndex, value);
+	if (beamIndex / 2 > 0)
+	    strips.elementAt(beamIndex / 2 - 1).rhs = beams.elementAt(beamIndex / 2).leftHandSideStrips();
+	if (beamIndex / 2 < strips.size())
+	    strips.elementAt(beamIndex / 2).lhs = beams.elementAt(beamIndex / 2).rightHandSideStrips();
+	    
+	updateOsmModel();
+    }
+
+    
+    public void setCorridorPartType(int beamIndex, int partIndex, CorridorPart.Type type)
+    {
+	if (beamIndex % 2 == 0)
+	{
+	    beams.elementAt(beamIndex / 2).setCorridorPartType(partIndex, type);
+	    if (beamIndex / 2 > 0)
+		strips.elementAt(beamIndex / 2 - 1).rhs = beams.elementAt(beamIndex / 2).leftHandSideStrips();
+	    if (beamIndex / 2 < strips.size())
+		strips.elementAt(beamIndex / 2).lhs = beams.elementAt(beamIndex / 2).rightHandSideStrips();
+	}
+	else
+	{
+	    if (type != CorridorPart.Type.PASSAGE && type != CorridorPart.Type.VOID)
+		strips.elementAt(beamIndex / 2).setCorridorPartType(partIndex, type);
+	}
+	    
+	updateOsmModel();
+    }
+
+    
+    public void setCorridorPartSide(int beamIndex, int partIndex, CorridorPart.ReachableSide side)
+    {
+	beams.elementAt(beamIndex / 2).setCorridorPartSide(partIndex, side);
+	if (beamIndex / 2 > 0)
+	    strips.elementAt(beamIndex / 2 - 1).rhs = beams.elementAt(beamIndex / 2).leftHandSideStrips();
+	if (beamIndex / 2 < strips.size())
+	    strips.elementAt(beamIndex / 2).lhs = beams.elementAt(beamIndex / 2).rightHandSideStrips();
+	    
+	updateOsmModel();
+    }
+    
+    
+    public Type getType()
+    {
+	return type;
+    }
+    
+    public void setType(Type type)
+    {
+	this.type = type;
+	updateOsmModel();
+    }
+    
+    
+    public String getLevel()
+    {
+	return level;
+    }
+    
+    public void setLevel(String level)
+    {
+	this.level = level;
+	updateOsmModel();
+    }
+    
+    
+    private Vector<Beam> beams;
+    private Vector<Strip> strips;
+    private Type type;
+    private String level;
+    
+    DefaultComboBoxModel<String> structureBox;
+
+    
+    private void updateOsmModel()
+    {
+	distributeWays();
+	Main.map.mapView.repaint();
+    }
+        
+    
+    public class SweepPolygonCursor
+    {
+	public SweepPolygonCursor(int stripIndex, int partIndex)
+	{
+	    this.stripIndex = stripIndex;
+	    this.partIndex = partIndex;
+	}
+	
+	public boolean equals(SweepPolygonCursor rhs)
+	{
+	    return rhs != null
+		&& stripIndex == rhs.stripIndex && partIndex == rhs.partIndex;
+	}
+    
+	public int stripIndex;
+	public int partIndex;
+    }
+    
+    
+    private void distributeWays()
+    {
+	target.startGeographyBuild(beams, strips);
+    
+	Vector<Vector<Boolean>> stripRefs = new Vector<Vector<Boolean>>();
+	for (Strip strip : strips)
+	{
+	    Vector<Boolean> refs = new Vector<Boolean>();
+	    if (strip.lhs.size() < strip.rhs.size())
+		refs.setSize(strip.rhs.size());
+	    else
+		refs.setSize(strip.lhs.size());
+	    stripRefs.add(refs);
+	}
+	
+	Boolean truePtr = new Boolean(true);
+	for (int i = 0; i < stripRefs.size(); ++i)
+	{
+	    Vector<Boolean> refs = stripRefs.elementAt(i);
+	    for (int j = 0; j < refs.size(); ++j)
+	    {
+		if (refs.elementAt(j) == null)
+		{
+		    target.startWay();
+		
+		    SweepPolygonCursor cursor = new SweepPolygonCursor(i, j);
+		    
+		    boolean toTheLeft = true;
+		    while (stripRefs.elementAt(cursor.stripIndex).elementAt(cursor.partIndex) == null)
+		    {
+			stripRefs.elementAt(cursor.stripIndex).setElementAt(truePtr, cursor.partIndex);
+			if (toTheLeft && cursor.partIndex < strips.elementAt(cursor.stripIndex).lhs.size())
+			{
+			    target.appendCorridorPart(
+				strips.elementAt(cursor.stripIndex).partAt(cursor.partIndex),
+				strips.elementAt(cursor.stripIndex).geographyAt(cursor.partIndex),
+				cursor.stripIndex,
+				beams.elementAt(cursor.stripIndex).getBeamPartIndex(!toTheLeft, cursor.partIndex),
+				level);
+			    toTheLeft = beams.elementAt(cursor.stripIndex).appendNodes(
+				cursor, toTheLeft, target.beamAt(cursor.stripIndex), level);
+			}
+			else if (!toTheLeft && cursor.partIndex < strips.elementAt(cursor.stripIndex).rhs.size())
+			{
+			    target.appendCorridorPart(
+				strips.elementAt(cursor.stripIndex).partAt(cursor.partIndex),
+				strips.elementAt(cursor.stripIndex).geographyAt(cursor.partIndex),
+				cursor.stripIndex + 1,
+				beams.elementAt(cursor.stripIndex + 1).getBeamPartIndex(!toTheLeft, cursor.partIndex),
+				level);
+			    toTheLeft = beams.elementAt(cursor.stripIndex + 1).appendNodes(
+				cursor, toTheLeft, target.beamAt(cursor.stripIndex + 1), level);
+			}
+			else
+			    toTheLeft = appendUturn(cursor, toTheLeft);
+		    }
+		    
+		    target.finishWay(strips.elementAt(cursor.stripIndex), cursor.partIndex, j % 2 == 0, level);
+		}
+	    }
+	}
+	
+	target.finishGeographyBuild(type, level);
+    }
+    
+    
+    private boolean appendUturn(SweepPolygonCursor cursor, boolean toTheLeft)
+    {
+	Strip strip = strips.elementAt(cursor.stripIndex);
+	target.appendUturnNode(strip, cursor.partIndex, cursor.stripIndex,
+	    beams.elementAt(toTheLeft ? cursor.stripIndex + 1 : cursor.stripIndex).
+		getBeamPartIndex(toTheLeft, cursor.partIndex),
+	    toTheLeft, level);
+	
+	if (cursor.partIndex % 2 == 0)
+	    ++cursor.partIndex;
+	else
+	    --cursor.partIndex;
+	return !toTheLeft;
+    }
+}
Index: /applications/editors/josm/plugins/indoor_sweepline/src/indoor_sweepline/IndoorSweeplineWizardAction.java
===================================================================
--- /applications/editors/josm/plugins/indoor_sweepline/src/indoor_sweepline/IndoorSweeplineWizardAction.java	(revision 32103)
+++ /applications/editors/josm/plugins/indoor_sweepline/src/indoor_sweepline/IndoorSweeplineWizardAction.java	(revision 32103)
@@ -0,0 +1,64 @@
+package indoor_sweepline;
+
+import static org.openstreetmap.josm.tools.I18n.tr;
+
+import java.awt.event.ActionEvent;
+import javax.swing.JOptionPane;
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.actions.JosmAction;
+import org.openstreetmap.josm.data.projection.Projections;
+import org.openstreetmap.josm.gui.layer.Layer;
+import org.openstreetmap.josm.gui.layer.OsmDataLayer;
+import org.openstreetmap.josm.gui.MapView;
+
+
+public class IndoorSweeplineWizardAction extends JosmAction implements MapView.LayerChangeListener
+{
+    public IndoorSweeplineWizardAction()
+    {
+	super(tr("Concourse wizard ..."), null,
+	    tr("Opens up a wizard to create a concourse"), null, false);
+	MapView.addLayerChangeListener(this);
+    }
+
+    @Override
+    public void actionPerformed(ActionEvent event)
+    {
+	if (layer == null)
+	    JOptionPane.showMessageDialog(JOptionPane.getFrameForComponent(Main.parent),
+		"No default layer found.");
+	else if (!(layer instanceof OsmDataLayer))
+	    JOptionPane.showMessageDialog(JOptionPane.getFrameForComponent(Main.parent),
+		"The default layer is not an OSM layer.");
+	else if (Main.map == null)
+	    JOptionPane.showMessageDialog(JOptionPane.getFrameForComponent(Main.parent),
+		"No map found.");
+	else if (Main.map.mapView == null)
+	    JOptionPane.showMessageDialog(JOptionPane.getFrameForComponent(Main.parent),
+		"No map view found.");
+	else
+	    new IndoorSweeplineController((OsmDataLayer)layer,
+		Projections.inverseProject(Main.map.mapView.getCenter()));
+    }
+
+    
+    @Override
+    public void activeLayerChange(Layer oldLayer, Layer newLayer)
+    {
+	layer = newLayer;
+    }
+
+    @Override
+    public void layerAdded(Layer newLayer)
+    {
+    }
+
+    @Override
+    public void layerRemoved(Layer oldLayer)
+    {
+	if (layer == oldLayer)
+	    layer = null;
+    }
+        
+    private Layer layer;
+}
Index: /applications/editors/josm/plugins/indoor_sweepline/src/indoor_sweepline/IndoorSweeplineWizardDialog.java
===================================================================
--- /applications/editors/josm/plugins/indoor_sweepline/src/indoor_sweepline/IndoorSweeplineWizardDialog.java	(revision 32103)
+++ /applications/editors/josm/plugins/indoor_sweepline/src/indoor_sweepline/IndoorSweeplineWizardDialog.java	(revision 32103)
@@ -0,0 +1,575 @@
+package indoor_sweepline;
+
+import static org.openstreetmap.josm.tools.I18n.tr;
+
+import java.awt.Component;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.List;
+import java.util.Vector;
+import javax.swing.AbstractAction;
+import javax.swing.DefaultCellEditor;
+import javax.swing.DefaultComboBoxModel;
+import javax.swing.JButton;
+import javax.swing.JComboBox;
+import javax.swing.JDialog;
+import javax.swing.JLabel;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JTable;
+import javax.swing.JTextField;
+import javax.swing.event.DocumentEvent;
+import javax.swing.event.DocumentListener;
+import javax.swing.event.TableModelEvent;
+import javax.swing.event.TableModelListener;
+import javax.swing.table.DefaultTableModel;
+import javax.swing.table.TableColumn;
+import javax.swing.table.TableModel;
+import org.openstreetmap.josm.Main;
+
+
+public class IndoorSweeplineWizardDialog extends JDialog
+{
+    public IndoorSweeplineWizardDialog(IndoorSweeplineController controller)
+    {
+	super(JOptionPane.getFrameForComponent(Main.parent), "Indoor Sweepline Wizard", false);
+	
+	this.controller = controller;
+	beamIndex = 0;
+	prev = new PrevAction();
+	next = new NextAction();
+	
+	GridbagPanel panel = new GridbagPanel();
+	
+	panel.add(new JLabel(tr("Vertical layer:")), 0, 0, 3, 1);
+	panel.add(makeLevelField(), 3, 0, 1, 1);
+	panel.add(new JLabel(tr("Structure type:")), 0, 1, 3, 1);
+	panel.add(typeBox(), 3, 1, 1, 1);
+	
+	panel.add(new JButton(prev), 0, 2, 1, 1);
+	panel.add(structureBox(), 1, 2, 1, 1);	
+	panel.add(new JButton(next), 2, 2, 2, 1);
+
+	panel.add(new JLabel(tr("Strip width:")), 0, 3, 3, 1);
+	panel.add(makeWidthField(), 3, 3, 1, 1);
+
+	panel.add(makeStructureTable(), 0, 4, 4, 1);
+	
+	add(panel);
+	pack();
+	refresh();
+    }
+    
+
+    public void setVisible(boolean visible)
+    {	
+	if (visible)
+	    setLocationRelativeTo(JOptionPane.getFrameForComponent(Main.parent));
+	super.setVisible(visible);
+    }
+    
+    
+    private void refresh()
+    {
+	inRefresh = true;
+	
+	leftRightCount = controller.leftRightCount();
+	prev.setEnabled(beamIndex > 0);
+	
+	DefaultComboBoxModel<String> structureBoxModel = controller.structures();
+	structureBoxModel.setSelectedItem(structureBoxModel.getElementAt(beamIndex));
+	
+	try
+	{
+	    stripWidth.setEditable(beamIndex % 2 == 1);
+	    if (beamIndex % 2 == 0)
+		stripWidth.setText("---");
+	    else
+		stripWidth.setText(Double.toString(controller.getStripWidth(beamIndex)));
+	}
+	catch (IllegalStateException ex)
+	{
+	}
+	
+	try
+	{
+	    level.setText(controller.getLevel());
+	}
+	catch (IllegalStateException ex)
+	{
+	}
+	
+	typeBoxModel.setSelectedItem(structureTypeToString(controller.getType()));
+	
+	
+	structureTableModel.setRowCount(0);
+	if (beamIndex % 2 == 0)
+	{
+	    Vector<Object> row = new Vector<Object>();
+	    row.addElement("");
+	    row.addElement("");
+	    row.addElement("");
+	    structureTableModel.addRow(row);
+	    
+	    List<CorridorPart> parts = controller.getBeamParts(beamIndex);
+	    for (CorridorPart part : parts)
+	    {
+		row = new Vector<Object>();
+		row.addElement(Double.toString(part.width));
+		row.addElement(corridorPartTypeToString(part.getType()));
+		row.addElement(corridorPartSideToString(part.getSide()));
+		structureTableModel.addRow(row);
+	    }
+	    row = new Vector<Object>();
+	    row.addElement("");
+	    row.addElement("");
+	    row.addElement("");
+	    structureTableModel.addRow(row);
+	    structureTableModel.isBeam = true;
+	}
+	else
+	{
+	    Strip strip = controller.getStrip(beamIndex);
+	    for (int i = 0; i < strip.lhs.size() || i < strip.rhs.size(); ++i)
+	    {
+		Vector<Object> row = new Vector<Object>();
+		String position = i < strip.lhs.size() ? strip.lhs.elementAt(i).toString() : "X";
+		position += " - " + (i < strip.rhs.size() ? strip.rhs.elementAt(i).toString() : "X");
+		row.addElement(position);
+		row.addElement(i < strip.parts.size() ?
+		    corridorPartTypeToString(strip.parts.elementAt(i).getType()) : "wall");
+		row.addElement(i < strip.parts.size() ?
+		    corridorPartSideToString(strip.parts.elementAt(i).getSide()) : "all");
+		structureTableModel.addRow(row);
+	    }
+	    structureTableModel.isBeam = false;
+	}
+	
+	inRefresh = false;
+    }
+    
+    
+    private String corridorPartTypeToString(CorridorPart.Type type)
+    {
+	if (type == CorridorPart.Type.VOID)
+	    return "void";
+	else if (type == CorridorPart.Type.PASSAGE)
+	    return "passage";
+	else if (type == CorridorPart.Type.WALL)
+	    return "wall";
+	else if (type == CorridorPart.Type.STAIRS_UP)
+	    return "stairs to upper level";
+	else if (type == CorridorPart.Type.STAIRS_DOWN)
+	    return "stairs to lower level";
+	else if (type == CorridorPart.Type.ESCALATOR_UP_LEAVING)
+	    return "escalator leaving to upper level";
+	else if (type == CorridorPart.Type.ESCALATOR_UP_ARRIVING)
+	    return "escalator arriving from upper level";
+	else if (type == CorridorPart.Type.ESCALATOR_UP_BIDIRECTIONAL)
+	    return "escalator (reversible) to upper level";
+	else if (type == CorridorPart.Type.ESCALATOR_DOWN_LEAVING)
+	    return "escalator leaving to lower level";
+	else if (type == CorridorPart.Type.ESCALATOR_DOWN_ARRIVING)
+	    return "escalator arriving from lower level";
+	else if (type == CorridorPart.Type.ESCALATOR_DOWN_BIDIRECTIONAL)
+	    return "escalator (reversible) to lower level";
+	else if (type == CorridorPart.Type.ELEVATOR)
+	    return "elevator";
+	return "";
+    }
+    
+    
+    private CorridorPart.Type parseCorridorPartType(String val)
+    {
+	if (val == "void")
+	    return CorridorPart.Type.VOID;
+	else if (val == "passage")
+	    return CorridorPart.Type.PASSAGE;
+	else if (val == "wall")
+	    return CorridorPart.Type.WALL;
+	else if (val == "stairs to upper level")
+	    return CorridorPart.Type.STAIRS_UP;
+	else if (val == "stairs to lower level")
+	    return CorridorPart.Type.STAIRS_DOWN;
+	else if (val == "escalator leaving to upper level")
+	    return CorridorPart.Type.ESCALATOR_UP_LEAVING;
+	else if (val == "escalator arriving from upper level")
+	    return CorridorPart.Type.ESCALATOR_UP_ARRIVING;
+	else if (val == "escalator (reversible) to upper level")
+	    return CorridorPart.Type.ESCALATOR_UP_BIDIRECTIONAL;
+	else if (val == "escalator leaving to lower level")
+	    return CorridorPart.Type.ESCALATOR_DOWN_LEAVING;
+	else if (val == "escalator arriving from lower level")
+	    return CorridorPart.Type.ESCALATOR_DOWN_ARRIVING;
+	else if (val == "escalator (reversible) to lower level")
+	    return CorridorPart.Type.ESCALATOR_DOWN_BIDIRECTIONAL;
+	else if (val == "elevator")
+	    return CorridorPart.Type.ELEVATOR;
+	return CorridorPart.Type.VOID;
+    }
+    
+    
+    private String corridorPartSideToString(CorridorPart.ReachableSide side)
+    {
+	if (side == CorridorPart.ReachableSide.ALL)
+	    return "all";
+	else if (side == CorridorPart.ReachableSide.FRONT)
+	    return "front";
+	else if (side == CorridorPart.ReachableSide.BACK)
+	    return "back";
+	else if (side == CorridorPart.ReachableSide.LEFT)
+	    return "left";
+	else if (side == CorridorPart.ReachableSide.RIGHT)
+	    return "right";
+	return "";
+    }
+    
+    
+    private CorridorPart.ReachableSide parseCorridorPartSide(String val)
+    {
+	if (val == "all")
+	    return CorridorPart.ReachableSide.ALL;
+	else if (val == "front")
+	    return CorridorPart.ReachableSide.FRONT;
+	else if (val == "back")
+	    return CorridorPart.ReachableSide.BACK;
+	else if (val == "left")
+	    return CorridorPart.ReachableSide.LEFT;
+	else if (val == "right")
+	    return CorridorPart.ReachableSide.RIGHT;
+	return CorridorPart.ReachableSide.ALL;
+    }
+    
+    
+    private String structureTypeToString(IndoorSweeplineModel.Type type)
+    {
+	if (type == IndoorSweeplineModel.Type.CORRIDOR)
+	    return "corridor";
+	else if (type == IndoorSweeplineModel.Type.PLATFORM)
+	    return "platform";
+	return "";
+    }
+    
+    
+    private JComboBox structureBox()
+    {
+	JComboBox structureBox = new JComboBox<String>(controller.structures());
+	structureBox.addActionListener(new StructureBoxListener());
+	return structureBox;
+    }
+    
+    
+    private IndoorSweeplineController controller;
+    
+    private int beamIndex;
+    private int leftRightCount;
+    private PrevAction prev;
+    private NextAction next;
+    boolean inRefresh;
+    
+    
+    private JComboBox typeBox()
+    {
+	if (typeBoxModel == null)
+	{
+	    typeBoxModel = new DefaultComboBoxModel<String>();
+	    typeBoxModel.addElement("corridor");
+	    typeBoxModel.addElement("platform");
+	}
+	JComboBox typeBox = new JComboBox<String>(typeBoxModel);
+	typeBox.addActionListener(new TypeBoxListener());
+	return typeBox;
+    }
+    
+    private DefaultComboBoxModel<String> typeBoxModel;
+    
+    
+    private class TypeBoxListener implements ActionListener
+    {
+	public void actionPerformed(ActionEvent e)
+	{
+	    if (inRefresh)
+		return;
+		
+	    String entry = (String)((JComboBox)e.getSource()).getSelectedItem();
+	    if (entry == "corridor")
+		controller.setType(IndoorSweeplineModel.Type.CORRIDOR);
+	    else
+		controller.setType(IndoorSweeplineModel.Type.PLATFORM);
+		
+	    refresh();
+	}
+    }
+    
+    
+    private class PrevAction extends AbstractAction
+    {
+	public PrevAction()
+	{
+	    super("Prev");
+	}
+    
+	public void actionPerformed(ActionEvent e)
+	{
+	    if (inRefresh)
+		return;
+		
+	    if (beamIndex > 0)
+		--beamIndex;
+	    refresh();
+	}
+    }
+    
+    
+    private class NextAction extends AbstractAction
+    {
+	public NextAction()
+	{
+	    super("Next");
+	}
+    
+	public void actionPerformed(ActionEvent e)
+	{
+	    if (inRefresh)
+		return;
+		
+	    ++beamIndex;
+	    if (beamIndex >= leftRightCount)
+		controller.addRightStructure();
+	    refresh();
+	}
+    }
+    
+    
+    private class StructureBoxListener implements ActionListener
+    {
+	public void actionPerformed(ActionEvent e)
+	{
+	    if (inRefresh)
+		return;
+		
+	    String entry = (String)((JComboBox)e.getSource()).getSelectedItem();
+	    DefaultComboBoxModel<String> structureBoxModel = controller.structures();
+	    for (int i = 0; i < structureBoxModel.getSize(); ++i)
+	    {
+		if (structureBoxModel.getElementAt(i).equals(entry))
+		    beamIndex = i;
+	    }
+	    refresh();
+	}
+    }
+    
+    
+    private JTextField stripWidth;
+    
+    private JTextField makeWidthField()
+    {
+	stripWidth = new JTextField(5);
+	stripWidth.getDocument().addDocumentListener(new StripWidthListener());
+	return stripWidth;
+    }
+    
+    
+    private class StripWidthListener implements DocumentListener
+    {
+	public void changedUpdate(DocumentEvent e)
+	{
+	    update(e);
+	}
+	
+	public void insertUpdate(DocumentEvent e)
+	{
+	    update(e);
+	}
+	
+	public void removeUpdate(DocumentEvent e)
+	{
+	    update(e);
+	}
+	
+	
+	private void update(DocumentEvent e)
+	{
+	    if (inRefresh)
+		return;
+	    
+	    try
+	    {
+		if (beamIndex % 2 == 1)
+		    controller.setStripWidth(beamIndex, Double.parseDouble(stripWidth.getText()));
+	    }
+	    catch (NumberFormatException ex)
+	    {
+	    }
+	    
+	    refresh();
+	}
+    }
+
+    
+    private JTextField level;
+    
+    private JTextField makeLevelField()
+    {
+	level = new JTextField(5);
+	level.getDocument().addDocumentListener(new LevelFieldListener());
+	return level;
+    }
+    
+    
+    private class LevelFieldListener implements DocumentListener
+    {
+	public void changedUpdate(DocumentEvent e)
+	{
+	    update(e);
+	}
+	
+	public void insertUpdate(DocumentEvent e)
+	{
+	    update(e);
+	}
+	
+	public void removeUpdate(DocumentEvent e)
+	{
+	    update(e);
+	}
+	
+	
+	private void update(DocumentEvent e)
+	{
+	    if (inRefresh)
+		return;
+	    
+	    controller.setLevel(level.getText());
+	    
+	    refresh();
+	}
+    }
+
+    
+    private class StructureTableModel extends DefaultTableModel
+    {
+	@Override
+	public boolean isCellEditable(int row, int column)
+	{
+	    return isBeam || column == 1;
+	}
+	
+	public boolean isBeam;
+    }
+    
+    private StructureTableModel structureTableModel;
+    
+    private JScrollPane makeStructureTable()
+    {
+	structureTableModel = new StructureTableModel();	
+	structureTableModel.addColumn("Width");
+	structureTableModel.addColumn("Type");
+	structureTableModel.addColumn("Reachable Side");
+	structureTableModel.addTableModelListener(new StructureTableListener());
+	
+	JTable table = new JTable(structureTableModel);
+	
+	TableColumn column = table.getColumnModel().getColumn(1);
+	JComboBox<String> comboBox = new JComboBox<String>();
+	comboBox.addItem("void");
+	comboBox.addItem("passage");
+	comboBox.addItem("wall");
+	comboBox.addItem("stairs to upper level");
+	comboBox.addItem("stairs to lower level");
+	comboBox.addItem("escalator leaving to upper level");
+	comboBox.addItem("escalator arriving from upper level");
+	comboBox.addItem("escalator (reversible) to upper level");
+	comboBox.addItem("escalator leaving to lower level");
+	comboBox.addItem("escalator arriving from lower level");
+	comboBox.addItem("escalator (reversible) to lower level");
+	comboBox.addItem("elevator");
+	column.setCellEditor(new DefaultCellEditor(comboBox));
+
+	column = table.getColumnModel().getColumn(2);
+	comboBox = new JComboBox<String>();
+	comboBox.addItem("all");
+	comboBox.addItem("left");
+	comboBox.addItem("right");
+	column.setCellEditor(new DefaultCellEditor(comboBox));
+
+	return new JScrollPane(table);
+    }
+    
+    private class StructureTableListener implements TableModelListener
+    {
+	public void tableChanged(TableModelEvent e)
+	{
+	    if (inRefresh)
+		return;
+	    
+	    int column = e.getColumn();
+	    int row = e.getFirstRow();
+	    if (column == 0 && beamIndex % 2 == 0)
+	    {
+		try
+		{
+		    if (row == 0 || row == structureTableModel.getRowCount() - 1)
+			controller.addCorridorPart(beamIndex, row != 0,
+			    Double.parseDouble(((TableModel)e.getSource()).getValueAt(row, column).toString()));
+		    else
+			controller.setCorridorPartWidth(beamIndex, row - 1,
+			    Double.parseDouble(((TableModel)e.getSource()).getValueAt(row, column).toString()));
+		}
+		catch (NumberFormatException ex)
+		{
+		}
+	    }
+	    else if (column == 1 && beamIndex % 2 == 0)
+	    {
+		if (row > 0 && row < structureTableModel.getRowCount() - 1)
+		    controller.setCorridorPartType(beamIndex, row - 1,
+			parseCorridorPartType(((TableModel)e.getSource()).getValueAt(row, column).toString()));
+	    }
+	    else if (column == 1 && beamIndex % 2 == 1)
+	    {
+		controller.setCorridorPartType(beamIndex, row,
+		    parseCorridorPartType(((TableModel)e.getSource()).getValueAt(row, column).toString()));
+	    }
+	    else if (column == 2 && beamIndex % 2 == 0)
+	    {
+		if (row > 0 && row < structureTableModel.getRowCount() - 1)
+		    controller.setCorridorPartSide(beamIndex, row - 1,
+			parseCorridorPartSide(((TableModel)e.getSource()).getValueAt(row, column).toString()));
+	    }
+	    
+	    refresh();
+	}
+    }
+    
+    
+    private class GridbagPanel extends JPanel
+    {
+	public GridbagPanel()
+	{
+	    gridbag = new GridBagLayout();
+	    layoutCons = new GridBagConstraints();
+	    setLayout(gridbag);
+	}
+	
+	public void add(Component comp, int gridx, int gridy, int gridwidth, int gridheight)
+	{
+	    layoutCons.gridx = gridx;
+	    layoutCons.gridy = gridy;
+	    layoutCons.gridwidth = gridwidth;
+	    layoutCons.gridheight = gridheight;
+	    layoutCons.weightx = 0.0;
+	    layoutCons.weighty = 0.0;
+	    layoutCons.fill = GridBagConstraints.BOTH;
+	
+	    gridbag.setConstraints(comp, layoutCons);
+	    add(comp);
+	}
+	
+	private GridBagLayout gridbag;
+	private GridBagConstraints layoutCons;
+    }
+}
Index: /applications/editors/josm/plugins/indoor_sweepline/src/indoor_sweepline/ModelGeography.java
===================================================================
--- /applications/editors/josm/plugins/indoor_sweepline/src/indoor_sweepline/ModelGeography.java	(revision 32103)
+++ /applications/editors/josm/plugins/indoor_sweepline/src/indoor_sweepline/ModelGeography.java	(revision 32103)
@@ -0,0 +1,252 @@
+package indoor_sweepline;
+
+import java.util.List;
+import java.util.Vector;
+import org.openstreetmap.josm.data.coor.LatLon;
+import org.openstreetmap.josm.data.osm.DataSet;
+import org.openstreetmap.josm.data.osm.Node;
+import org.openstreetmap.josm.data.osm.OsmPrimitive;
+import org.openstreetmap.josm.data.osm.Relation;
+import org.openstreetmap.josm.data.osm.RelationMember;
+import org.openstreetmap.josm.data.osm.Way;
+
+
+public class ModelGeography
+{
+    public ModelGeography(DataSet dataSet, LatLon center)
+    {
+	beamsGeography = new Vector<BeamGeography>();
+	
+	this.dataSet = dataSet;
+	this.center = center;
+    
+	wayPool = new Vector<Way>();
+	wayPoolCount = 0;
+	nodePool = new Vector<Node>();
+	nodePoolCount = 0;
+	
+	nodes = null;
+	multipolygon = null;
+	members = null;
+    }
+    
+
+    private Vector<BeamGeography> beamsGeography;
+    
+    private DataSet dataSet;
+    private LatLon center;
+    
+    private Vector<Way> wayPool;
+    private int wayPoolCount;
+    private Vector<Node> nodePool;
+    private int nodePoolCount;
+    
+    private Vector<Node> nodes;
+    private Relation multipolygon;
+    private Vector<RelationMember> members;
+
+    
+    public void appendNode(Node node)
+    {
+	nodes.add(node);
+    }
+    
+    
+    public DataSet getDataSet()
+    {
+	return dataSet;
+    }
+    
+    
+    public BeamGeography beamAt(int i)
+    {
+	return beamsGeography.elementAt(i);
+    }
+
+    
+    public void startGeographyBuild(Vector<Beam> beams, Vector<Strip> strips)
+    {
+	if (beamsGeography.size() < beams.size())
+	    beamsGeography.setSize(beams.size());
+	
+	double offset = 0;	
+	for (int i = 0; i < beams.size(); ++i)
+	{
+	    if (beamsGeography.elementAt(i) == null)
+		beamsGeography.setElementAt(new BeamGeography(dataSet, this), i);
+	    beamsGeography.elementAt(i).adjustNodes(new LatLon(center.lat(), addMetersToLon(center, offset)),
+		beams.elementAt(i).getBeamParts());
+		
+	    if (i < strips.size())
+		offset += strips.elementAt(i).width;
+	}
+	
+	nodePoolCount = 0;
+	wayPoolCount = 0;
+	
+	members = new Vector<RelationMember>();
+	if (multipolygon != null)
+	    multipolygon.setMembers(members);
+    }
+    
+    
+    public void startWay()
+    {
+	nodes = new Vector<Node>();
+    }
+    
+    
+    public void finishWay(Strip strip, int partIndex, boolean isOuter, String level)
+    {
+	if (nodes.size() > 0)
+	{
+	    CorridorPart part = strip.partAt(partIndex);
+	    strip.geographyAt(partIndex).appendNodes(part.getType(), part.getSide(), level,
+		nodes.elementAt(nodes.size()-1).getCoor(), nodes.elementAt(0).getCoor(), this);
+	    nodes.add(nodes.elementAt(0));
+	}
+	assignNds(nodes);
+	members.add(new RelationMember(isOuter ? "outer" : "inner", wayPool.elementAt(wayPoolCount)));
+	++wayPoolCount;
+    }
+    
+    
+    public void appendCorridorPart(CorridorPart part, CorridorGeography partGeography, int beamIndex, int partIndex,
+	String level)
+    {
+	if (nodes.size() > 0)
+	    partGeography.appendNodes(part.getType(), part.getSide(), level,
+		nodes.elementAt(nodes.size()-1).getCoor(),
+		beamsGeography.elementAt(beamIndex).coorAt(partIndex), this);
+    }
+    
+    
+    public void appendUturnNode(Strip strip, int partIndex, int stripIndex, int beamNodeIndex, boolean toTheLeft,
+	String level)
+    {
+	if (toTheLeft)
+	    assignCoor(addMeterOffset(beamsGeography.elementAt(stripIndex + 1).coorAt(beamNodeIndex),
+		0, -strip.width / 2.));
+	else
+	    assignCoor(addMeterOffset(beamsGeography.elementAt(stripIndex).coorAt(beamNodeIndex),
+		0, strip.width / 2.));
+	
+	if (nodes.size() > 0)
+	{
+	    CorridorPart part = strip.partAt(partIndex);
+	    strip.geographyAt(partIndex).appendNodes(part.getType(), part.getSide(), level,
+		nodes.elementAt(nodes.size()-1).getCoor(), nodePool.elementAt(nodePoolCount).getCoor(), this);
+	}
+	nodes.add(nodePool.elementAt(nodePoolCount));
+	++nodePoolCount;
+    }
+    
+    
+    public void finishGeographyBuild(IndoorSweeplineModel.Type type, String level)
+    {
+	for (int i = nodePoolCount; i < nodePool.size(); ++i)
+	    nodePool.elementAt(i).setDeleted(true);
+	nodePool.setSize(nodePoolCount);
+	
+	for (int i = wayPoolCount; i < wayPool.size(); ++i)
+	    wayPool.elementAt(i).setDeleted(true);
+	wayPool.setSize(wayPoolCount);
+	
+	adjustMultipolygonRelation(type, level);
+    }
+    
+    
+    private static LatLon addMeterOffset(LatLon latLon, double south, double east)
+    {
+	double scale = Math.cos(latLon.lat() * (Math.PI/180.));
+	return new LatLon(latLon.lat() - south *(360./4e7), latLon.lon() + east / scale *(360./4e7));
+    }
+
+    
+    private static double addMetersToLon(LatLon latLon, double east)
+    {
+	double scale = Math.cos(latLon.lat() * (Math.PI/180.));
+	return latLon.lon() + east / scale *(360./4e7);
+    }
+
+    
+    private void assignCoor(LatLon latLon)
+    {
+	if (nodePoolCount < nodePool.size())
+	    nodePool.elementAt(nodePoolCount).setCoor(latLon);
+	else
+	{
+	    Node node = new Node(latLon);
+	    dataSet.addPrimitive(node);
+	    nodePool.add(node);
+	}
+    }
+    
+    
+    private void assignNds(List<Node> nodes)
+    {
+	if (wayPoolCount < wayPool.size())
+	    wayPool.elementAt(wayPoolCount).setNodes(nodes);
+	else
+	{
+	    Way way = new Way();
+	    way.setNodes(nodes);
+	    dataSet.addPrimitive(way);
+	    wayPool.add(way);
+	}
+    }
+    
+    
+    private static void addPolygonTags(IndoorSweeplineModel.Type type, String level, OsmPrimitive obj)
+    {
+	if (type == IndoorSweeplineModel.Type.PLATFORM)
+	{
+	    obj.put("railway", "platform");
+	    obj.put("public_transport", "platform");
+	    obj.put("area", "yes");
+	    obj.put("level", level);
+	}
+	else
+	{
+	    obj.put("highway", "pedestrian");
+	    obj.put("indoor", "corridor");
+	    obj.put("area", "yes");
+	    obj.put("level", level);
+	}
+    }
+    
+    
+    private void adjustMultipolygonRelation(IndoorSweeplineModel.Type type, String level)
+    {
+	if (members.size() > 1)
+	{
+	    if (wayPool.size() > 0)
+		wayPool.elementAt(0).removeAll();
+	    
+	    if (multipolygon == null)
+	    {
+		multipolygon = new Relation();
+		dataSet.addPrimitive(multipolygon);
+		
+		multipolygon.removeAll();
+		multipolygon.put("type", "multipolygon");
+		addPolygonTags(type, level, multipolygon);
+	    }
+	    multipolygon.setMembers(members);
+	}
+	else
+	{
+	    if (multipolygon != null)
+	    {
+		multipolygon.setDeleted(true);
+		multipolygon = null;
+	    }
+	    
+	    if (wayPool.size() == 1)
+	    {
+		wayPool.elementAt(0).removeAll();
+		addPolygonTags(type, level, wayPool.elementAt(0));
+	    }
+	}
+    }
+}
Index: /applications/editors/josm/plugins/indoor_sweepline/src/indoor_sweepline/Strip.java
===================================================================
--- /applications/editors/josm/plugins/indoor_sweepline/src/indoor_sweepline/Strip.java	(revision 32103)
+++ /applications/editors/josm/plugins/indoor_sweepline/src/indoor_sweepline/Strip.java	(revision 32103)
@@ -0,0 +1,68 @@
+package indoor_sweepline;
+
+
+import java.util.Vector;
+import org.openstreetmap.josm.data.osm.DataSet;
+
+
+public class Strip
+{
+    public Strip(DataSet dataSet)
+    {
+	width = 10.;
+	parts = new Vector<CorridorPart>();
+	partsGeography = new Vector<CorridorGeography>();
+	lhs = new Vector<Double>();
+	rhs = new Vector<Double>();
+	
+	this.dataSet = dataSet;
+    }
+
+    
+    public void setCorridorPartType(int partIndex, CorridorPart.Type type)
+    {
+	while (parts.size() <= partIndex)
+	{
+	    parts.add(new CorridorPart(0., CorridorPart.Type.WALL,
+		parts.size() % 2 == 0 ? CorridorPart.ReachableSide.FRONT :
+		CorridorPart.ReachableSide.BACK));
+	    partsGeography.add(new CorridorGeography(dataSet));
+	}
+	parts.elementAt(partIndex).setType(type, CorridorPart.ReachableSide.ALL);
+    }
+    
+    
+    public CorridorPart partAt(int i)
+    {
+	while (parts.size() <= i)
+	{
+	    parts.add(new CorridorPart(0., CorridorPart.Type.WALL,
+		parts.size() % 2 == 0 ? CorridorPart.ReachableSide.FRONT :
+		CorridorPart.ReachableSide.BACK));
+	    partsGeography.add(new CorridorGeography(dataSet));
+	}
+	return parts.elementAt(i);
+    }
+    
+    
+    public CorridorGeography geographyAt(int i)
+    {
+	while (parts.size() <= i)
+	{
+	    parts.add(new CorridorPart(0., CorridorPart.Type.WALL,
+		parts.size() % 2 == 0 ? CorridorPart.ReachableSide.FRONT :
+		CorridorPart.ReachableSide.BACK));
+	    partsGeography.add(new CorridorGeography(dataSet));
+	}
+	return partsGeography.elementAt(i);
+    }
+    
+    
+    public double width;
+    public Vector<CorridorPart> parts;
+    public Vector<CorridorGeography> partsGeography;
+    public Vector<Double> lhs;
+    public Vector<Double> rhs;
+    
+    private DataSet dataSet;
+}
